JPEG Compression

G

Guest

Is there anyway I can retrieve the information on the quailty setting of a
jpeg.

In my project I can optimize the image by setting the width and height and
the quality setting.

I use the EncoderParameters to set the jpeg quality.

To avoid optimizing the same image twice I would like to get the information
about the quailty setting that has been applied to the image, is this
possible? or is there another way of checking..
 
C

Carl Daniel [VC++ MVP]

Brian said:
Is there anyway I can retrieve the information on the quailty setting of a
jpeg.

In my project I can optimize the image by setting the width and height and
the quality setting.

I use the EncoderParameters to set the jpeg quality.

To avoid optimizing the same image twice I would like to get the
information
about the quailty setting that has been applied to the image, is this
possible? or is there another way of checking..

That information is not stored in the JPEG file, at least not overtly. In
fact, there's no concept of "quality setting" in the JPEG standard at all.
Rather, that quality setting is used to initialize a set of tables of
"quantization coefficients" which are used during the compression and
decompression. It's probably possible to determine the quality setting for
a given image if you know exactly what software produced the image, but
there's not one single standard algorithm that's used to transform the
quality setting into the coefficient tables, so without know how the image
was made it'd just be a guess.

If the image is from a camera, then it's likely to be an "EXIF" image, which
is simple a standard JFIF (aka JPEG) image with additional tags embedded
that contain information about the camera settings, date, time, etc. It's
possible that there's an EXIF tag for compression quality - I don't have the
EXIF standard here to check. Even if there is such a tag, there's no
guarantee that any given image willl contain that tag.

In short, what you ask is impossible in the general case, but might be
possible in some special cases.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top