factors determining filesize

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
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: factors determining filesize

Post by glennrp » 2006-10-14T17:10:34-07:00

chizor wrote: hi all,

i am converting a hundred JPEGs from different cameras to thumbnails at fixed resolutions ('60x50!', etc.) and qualities (35, say). thumbnails made from a 4MP camera average 21K and those from 2MP cameras, 7K. since the output files have the same dimensions and compression level, i have not been able to explain this.

If you aren't stripping out the profiles and thumbnails, different cameras could yield different file sizes.
  • convert -strip in.jpg out.jpg
in another case, i have found that quality level 100 yields smaller PNGs than some lower levels. given that PNG is a lossless format, what does this parameter impact besides processing time?

In PNG outputs, filesize isn't proportional to quality. Quality is a two-part
value. The 10's digit, which runs from 0 to 9, is the compression
quality. Generally, the higher the better compression and the greater the computer time spent. The one's digit is the "PNG filter type". 0 means
no filtering and 5 means adaptive. For photos, quality 95 usually
yields the best compression, while for drawings quality 90 usualy does
the best.
in both cases, which other settings might help me achieve a reliably low filesize?


User avatar
Posts: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony » 2006-10-15T19:48:04-07:00

If you want to always reduce your PNG to minimin. Look at the pngcrush program from the web. It compresses the PNg using a number of differnt PNG filters and then picks the best.
This works well as PNG is a lossless image format, so all formats retain all the image information that is present in the image.

Again remember to strip profiles, when generating smaller images, unless the information in profiles is important.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages

Post Reply