title: rmagick compress and convert png to jpg
body: <p>I am trying to compress a png and save it as jpg:</p>
  
  <pre><code>i = Image.read("http://ds4jk3cl4iz0o.cloudfront.net/e2558b0d34221d3270189320173dabc2.png").first
  </code></pre>
  
  <p>it's size is 799 kb:</p>
  
  <pre><code>http://ds4jk3cl4iz0o.cloudfront.net/e2558b0d34221d3270189320173dabc2.png=&gt;e2558b0d34221d3270189320173dabc2.png PNG 640x639 640x639+0+0 DirectClass 8-bit 799kb 
  </code></pre>
  
  <p>I set the format to jpeg and quality to 10 (i.e very poor quality so file size should be greatly reduced):</p>
  
  <pre><code>i.format = 'JPEG'
  
  i.write("itest10.png") { self.quality = 10 }
  </code></pre>
  
  <p>The size actually increases to 800kb!</p>
  
  <pre><code> =&gt; http://ds4jk3cl4iz0o.cloudfront.net/e2558b0d34221d3270189320173dabc2.png=&gt;itest40.png PNG 640x639 640x639+0+0 DirectClass 8-bit 800kb 
  </code></pre>
  
  <p>1) Why? </p>
  
  <p>2) How can I compress the photo so the size is &lt; 150kb ?</p>
  
  <p>Thanks!</p>