title: Automatically Convert PNG to JPG with Python
body: <p>I've written a Python program to retrieve an image from a URL using </p>
  
  <pre><code>msgImage = MIMEImage( urllib2.urlopen(chartURL).read() )
  msgRoot.attach(msgImage)
  </code></pre>
  
  <p>The image that I get from the URL is in PNG format, but I would like to embed a JPG version of it.  Is there a simple way to automatically convert the PNG msgImage into JPG for smaller attachments?</p>
  
  <p>Thanks for reading.  Any help is greatly appreciated.</p>