Page 1 of 1

Image size increasing while converting from JPG to PNG

Posted: 2017-12-19T03:21:37-07:00
by saurabh
Hi friends. I'm new to Image Magick.
Can someone please share commands to reduce PNG image size while converting it from JPG?
For example, input JPG size is 200 kb and output PNG size is 2000 kb.

Re: Image size increasing while converting from JPG to PNG

Posted: 2017-12-19T06:24:45-07:00
by snibgo
The image size (in pixels) isn't increasing. The file size (in bytes) is increasing.

JPG is effective at compressing photos because it records just 8 bits/channel/pixel, and the compression is lossy (it changes pixels), and it is designed for photo compression.

PNG is 8 or 16 bits/channel/pixel, with lossless compression, and wasn't designed for photos.

If you need PNG to be as small as possible, write them with "-depth 8" and then use pngcrush or similar, which tries the various compression parameters to find the smallest result.