title: Am I creating lossless PNG images?
body: <p>I am doing image processing in a scientific context. Whenever I need to save an image to the hard drive, I want to be able to reopen it at a later time and get exactly the data that I had before saving it. I exclusively use the PNG format, having always been under the impression that it is a lossless format. Is this always correct, provided I am not using the wrong bit-depth? Should encoder and decoder play no role at all? Specifically, the images I save </p>
  
  <ul>
  <li>are present as 2D numpy arrays</li>
  <li>have integer values from 0 to 255</li>
  <li>are encoded with the OpenCV <code>imwrite()</code> function, e.g. <code>cv2.imwrite("image.png", array)</code></li>
  </ul>