title: resize image in ruby on rails using rmagick without losing quality
body: <p>I need to resize an image in rmagick from its current size to a fixed width to a width of 300 without losing image quality. Currently I am doing following for a jpg image</p>
  
  <blockquote>
  <pre><code> if previewImage.columns &gt; 300
         previewImage.change_geometry!("300x") { |cols, rows, img|
             img.resize!(cols, rows)
         }
     end
  </code></pre>
  </blockquote>
  
  <p>am not sure if this the best way as I am losing sharpness in the resulting image. I want to be able to resize by losing the least amount of image quality.</p>
  
  <p>I know there are filters and compression techniques:
  JPG   JPEGCompression, LosslessJPEGCompression</p>
  
  <p>but don't know which would provide the best result or could i convert the image to png and then resize?</p>