Image size increasing while converting from JPG to PNG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
saurabh
Posts: 1
Joined: 2017-12-18T00:12:25-07:00
Authentication code: 1152

Image size increasing while converting from JPG to PNG

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image size increasing while converting from JPG to PNG

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply