I have the following code to convert PNG to JPG using Ruby RMagick and the converted image always have a border around it. Anyway to avoid it?
- Mac OS X 10.8.2
- ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin12]
- rmagick (2.13.1)
- MacPorts 2.1.2
- ImageMagick @6.8.0-2_0+q8+wmf (active)
Here is my code in irb:
irb(main):013:0* image = Magick::Image.read('term.png').first
=> term.png PNG 684x716 684x716+0+0 DirectClass 8-bit 48kb
irb(main):014:0> image.format = "JPG"
=> "JPG"
irb(main):015:0> image.write 'term.jpg'
=> term.png=>term.jpg JPG 684x716 684x716+0+0 DirectClass 8-bit 16kb
and here are the image before and after:
- BEFOE:
- AFTER: