I'm trying to "cut" a picture in half and flip both sides horizontally. See link below.
https://i.stack.imgur.com/mg9Qg.jpg
Original picture:
What the output needs to be:
What I'm getting
This is what I have, but all it does is flip the picture horizontally
def mirrorHorizontal(picture):
mirrorPoint = getHeight(picture)/2
height = getHeight(picture)
for x in range(0, getWidth(picture)):
for y in range(0, mirrorPoint):
topPixel = getPixel(picture, x, y)
bottomPixel = getPixel(picture, x, height - y - 1)
color = getColor(topPixel)
setColor(bottomPixel, color)
So how do I flip each side horizontally so that so that it comes out looking like the second picture?