I am trying to write a python function to flip the right half of the image in the left half. So far I have this code, but it works the other way around (it reflects from L to R). I know that this should be a few simple changes, but now I now have a block. Any help was appreciated.
def mirrorVertical(source): mirrorPoint = getWidth(source) / 2 width = getWidth(source) for y in range(0,getHeight(source)): for x in range(0,mirrorPoint): leftPixel = getPixel(source,x,y) rightPixel = getPixel(source,width - x - 1,y) color = getColor(leftPixel) setColor(rightPixel,color)
source share