Flip and Scroll

imagegram.py: 38 points


Now, you will do two slightly more complicated filters. For these filters, you will need to make a copy of the image. For more on how to make a copy, please see the Warmup.

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). Your result should be the ‘‘upside down’’ version of the original picture. This filter is identical to the vertical flip filter you designed in the warmup.

Vertical Flip Filter

Horizontal Scroll Filter

Scrolling 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

Again, once you’ve implemented a function, add the ability to call it from your looping menu and make sure to test it!