Skip to main content

Section 18.11 Write Code Questions Orig

Note 18.11.1.

Remember that it can take a bit of time to process all the pixels in a picture! Check for errors below the code if it is taking a long time, but if you don’t see any errors just wait.

Activity 18.11.2.

A grayscale picture is when the red, green, and blue value of a pixel are all equal to the average of the original pixel value. Write the code to turn the left half of the image gal2.jpg into gray scale.

Activity 18.11.3.

A grayscale picture is when the red, green, and blue value of a pixel are all equal to the average of the original pixel value. Create the code to turn the left half of the image gal2.jpg into gray scale.

Activity 18.11.4.

Define a procedure to negate an image. You can negate an image by setting each color value to 255 minus the current value. Write code to negate the kitten.jpg image.

Activity 18.11.5.

Define a procedure to negate an image. You can negate an image by setting each color value to 255 minus the current value. Create code to negate the kitten3.jpg image.

Activity 18.11.6.

Write code that copies the top half of the image kitten.jpg to the bottom half.

Activity 18.11.7.

Write code that copies the top half of the image kitten.jpg to the bottom half.

Activity 18.11.8.

Write a function to mirror the image swan.jpg from left to right around a vertical line in the middle of the image. Pass the image to the function. Do the import, create the image, call the function, and show the result.

Activity 18.11.9.

Create a function to mirror the image swan.jpg from left to right around a vertical line in the middle of the image. Pass the image to the function. Do the import, create the image, call the function, and show the result.

Activity 18.11.10.

Write code that flips the image vangogh.jpg across a horizontal line.

Activity 18.11.11.

Create code that flips the image vangogh.jpg across a horizontal line.
You have attempted of activities on this page.