Extracting JPEG quantization tables

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
findus
Posts: 14
Joined: 2012-08-14T07:57:42-07:00
Authentication code: 67789

Extracting JPEG quantization tables

Post by findus »

I would like to extract the quantization tables (also referred to as quantization matrices) from JPEG files, is it possible to do this with some imagemagick component?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Extracting JPEG quantization tables

Post by magick »

Consider calling the JPEG delegate library API directly to extract the JPEG quantization tables. ImageMagick accesses them in the coder/jpeg.c module but they are not exported.
findus
Posts: 14
Joined: 2012-08-14T07:57:42-07:00
Authentication code: 67789

Re: Extracting JPEG quantization tables

Post by findus »

magick wrote:Consider calling the JPEG delegate library API directly to extract the JPEG quantization tables. ImageMagick accesses them in the coder/jpeg.c module but they are not exported.
Where can I find this library?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Extracting JPEG quantization tables

Post by fmw42 »

findus wrote:
magick wrote:Consider calling the JPEG delegate library API directly to extract the JPEG quantization tables. ImageMagick accesses them in the coder/jpeg.c module but they are not exported.
Where can I find this library?
Search google for libjpeg. or see http://www.imagemagick.org/download/delegates/
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: Extracting JPEG quantization tables

Post by NicolasRobidoux »

Code: Select all

djpeg -verbose -verbose -verbose input.jpg junk.tga
will do that for you.
djpeg is part of the libjpeg and the libjpeg-turbo (often through the libjpeg-turbo-progs package in linux) libraries.
If your chip supports libjpeg-turbo, you are generally better off using it.
Warning: the libjpeg API is not as stable as one would wish. libjpeg-turbo's is more stable, and explicitly documented as matching specific versions of the libjpeg library. The features of libjpeg that libjpeg-turbo does not implement are not really useful.
Post Reply