title: python: convert base64 encoded png image to jpg
body: <p>I want to convert some base64 encoded png images to jpg using python. I know how to decode from base64 back to raw:</p>
  
  <pre><code>import base64 
  pngraw = base64.decodestring(png_b64text)
  </code></pre>
  
  <p>but how can I convert this now to jpg? Just writing pngraw to a file obviously only gives me a png file. <strong>I know I can use PIL, but HOW exactly would I do it?</strong> Thanks!</p>