title: How to convert PNG to JPG in Python?
body: <p>I'm trying to compare two images, one a <code>.png</code> and the other a <code>.jpg</code>. So I need to convert the <code>.png</code> file to a <code>.jpg</code> to get closer values for SSIM. Below is the code that I've tried, but I'm getting this error:</p>
  
  <blockquote>
    <p>AttributeError: 'tuple' object has no attribute 'dtype'</p>
  </blockquote>
  
  <pre><code>image2 = imread(thisPath + caption)
  image2 = io.imsave("jpgtest.jpg", (76, 59))
  image2 = cv2.cvtColor(image2, cv2.COLOR_BGR2GRAY)
  image2 = resize(image2, (76, 59))
  imshow("is it a jpg", image2)
  cv2.waitKey()
  </code></pre>