Flip and Scroll

Vertical Flip Filter: 5 points
Horizontal Scroll Filter: 6 points


Now, you will implement two slightly more complicated filters. Again, begin by making a copy of the image. Both of these functions require you to refer to the original picture’s values as you make the appropriate changes to your copy.

Vertical Flip Filter

In this function, you will reflect the image around its x-axis, so a pixel that was at (0,0) will be at (0, height-1). The result will be the ‘‘upside down’’ version of the original image. This filter is the vertical flip filter you designed in the warmup, meaning that you can use an import warmupgram_func statement at the top of your file and call the function with dot notation.

Vertical Flip Filter

Reminder

Once your filter is complete, don’t forget to commit and push your changes!

Horizontal Scroll Filter

The horizontal scroll filter should ask the user to specify some number of pixels, and should then shift the image that many pixels to the right. Pixels that would fall off the edge of the image should wrap around to the other size. Modular arithmetic % may come in handy here.

Horizontal Scroll Filter

Running and Testing Your Filters

Once you’ve implemented a function, update your placeholder for it in the looping menu. Make sure to test it both on its own and in combination with other filters!

Reminder

Once this is working don’t forget to commit and push your changes before moving on.