Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageMagick PNG Resize Increases File Size

I am resizing images using ImageMagick. If I pass a -resize WxH option it behaves as expected. But if I pass -resize WxH! (to ignore aspect ratio during resize), some images, especially PNGs, are actually increasing in size. A 200k image becomes 450k, a 170k image becomes 360k and so on.

Any ideas why this is hapenning and how to fix it?

Thanks

like image 265
Faisal Avatar asked Sep 29 '09 11:09

Faisal


People also ask

How do I resize an image in ImageMagick?

To resize an image to specific dimensions, use the convert command with an input file, the -resize parameter, your preferred dimensions, and an output filename: convert original. png -resize 100x100 new. png.

Is ImageMagick good?

If you're not sure what ImageMagick is, it's one of the greatest tools you could have on your computer, to manipulate images and a few other types of files.


1 Answers

After researching, I upgraded my ImageMagick version from 6.3.7 to 6.5.6, and now it is working great. Resizing images is generating smaller images and everything is OK.

like image 146
Faisal Avatar answered Sep 23 '22 20:09

Faisal