Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 18th, 2012  |  syntax: None  |  size: 0.37 KB  |  views: 71  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def mirrorHorizontal(picture):
  2.   height = getHeight(picture)/2
  3.   for x in range(0, getWidth(picture)):
  4.     for y in range(0, height):
  5.       topPixel = getPixel(picture, x, y)
  6.       bottomPixel = getPixel(picture, x, height - y - 1)
  7.       color = getColor(bottomPixel)
  8.       setColor(topPixel, color)
  9.       color = getColor(topPixel)
  10.       setColor(bottomPixel, color)