Write a function called:
def fadeToWhite(picture):
which first does a getPixels on the picture. It then traverses the pixels from start to finish. At each pixel, make it lighter, but gradually.
Assume we have the pixel which is ¼ of the way along and its red value is 100. Instead of increasing the 100 by a percentage, look at the difference between 255 and 100 which is 155. Take 25% of 155 and add that to 100 to give the pixels new red value. Do the same with green and blue.
At the half way point, take half of the difference between 255 and the current red and add it to the red. Same for green and blue.
The first pixel is left as is. The last pixel should be white.
Sample output:
mediasources-4edarbara.jpg
Zoom
R: 168 G: 131 B: 105 Color at location: