title: Jython/Python - Flipping a picture horizontally
body: <p>I'm trying to "cut" a picture in half and flip both sides horizontally. See link below.</p>
  
  <p><a href="http://imgur.com/a/FAksh" rel="nofollow noreferrer">http://imgur.com/a/FAksh</a></p>
  
  <p>Original picture:</p>
  
  <p><img src="https://i.stack.imgur.com/OWTBs.jpg" alt="enter image description here"></p>
  
  <p>What the output needs to be:</p>
  
  <p><img src="https://i.stack.imgur.com/ljBhN.png" alt="enter image description here"></p>
  
  <p>What I'm getting</p>
  
  <p><img src="https://i.stack.imgur.com/P1wwf.png" alt="enter image description here"></p>
  
  <p>This is what I have, but all it does is flip the picture horizontally</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>So how do I flip each side horizontally so that so that it comes out looking like the second picture?</p>