File size increase with convert

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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

The -scale option introduces new colors so one might expect an increase in size. You can fix by using -sample or by using -colors to reduce the number of colors in the image.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp »

Besides using -sample or -colors, you could write PNG with -quality 90
and probably get somewhat smaller files. ../glenn
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Are you using a modern version of ImageMagick, 5.5.7 or above? Older versions of ImageMagick did not compress GIF images because of the LZW compression patent.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

We get
  • -rw------- 1 magick magick 1432 Apr 20 08:20 pillsbury_bf10.gif
    -rw------- 1 magick magick 1439 Apr 28 13:48 pillsbury_bf10SMALL.gif
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

The -scale option increases the size because it introduces new colors. With -sample we go from 1432 to 534 bytes with your command.
Post Reply