How does ImageMagick know JPEG Quality

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
polakos

How does ImageMagick know JPEG Quality

Post by polakos »

Where does ImageMagick get the JPEG quality from? This is not stored anywhere in the file. Any help would be much appriciated.

Thanks
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: How does ImageMagick know JPEG Quality

Post by magick »

ImageMagick determines the JPEG compression quality from the quantization tables. In some cases its approximate. Add -debug coder to the command line and it will tell you whether the quality is exact or approximate.
polakos

Re: How does ImageMagick know JPEG Quality

Post by polakos »

Excellent! I just found the code block that is used. It would be nice if the identify program had an option for obtaining as much information as it could without actually decompressing the file. We use ImageMagick to scan millions of images at a time just to check JPEG quality. This can end up running for 3 weeks. I have used the method imagemagick uses to check the quality and can now scan much faster. In either case, excellent work!
Post Reply