title: Horizontal flip of Image on Python with pypng
body: <p>I am trying to horizontally flip an image (from left to right) on Python using PyPNG, I have written the following codes but it does not seem to work, anybody have any idea what I'm doing wrong here?</p>
  
  <pre><code>def horizontal_flip(image):
      rows = len(image)
      cols = len(image[0])
      new_image = []
      for r in range(rows):
          new_row = []
          for c in range(0,cols,3):
              if c != cols/2:
                  image[c:c+3], image[-c-3: -c] = image[-c-3: -c], image[c:c+3]
                  new_row.append(image[r][c])
          new_image.append(new_row)
      return new_image
  </code></pre>