Now you’ve done this already, remember? When you changed all of the pixels from an image into the negative. At the time, I gave you the loop structure to do this, and I told you not to look too closely at it. Now, we’re ready to reveal this mystery. On your left we’re going to start this program. We have a full loop. Because we want to iterate over all of the pixels, we’ll find out soon enough how many pixels there are. The structure’s very similar to the structure for working with words. Instead of getting the ith character, we get the ith pixel by getting the color at position i. And we can also set it, presumably after having changed it in some way. So here’s your basic loop. Get the pixel, process it, and put it back. Now, how many pixels do we have? We can ask the picture, and it’s going to tell us the number of pixels. And that is the exact analogue to the length of a string except that you should think of the pixels as being arranged like this. A row of pixels, another row and they all come one after another. When we ask for them. And eventually we reach all the pixels that way. I starts at zero. It goes up to the total pixel count. Is incremented at every step. We get the i pixel. And that way we get all of the pixels in the image. In our particular example. We simply compute the negative of the color, and then we can put it back. Finally, we want to load the picture, show it to the user, and then start processing it. Let’s run the code. Here is Eliza, all positive. And here she is, sadly negative. As you’ve seen, it’s just as easy to work with pictures as it is to work with words.