|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
JPEG CompressionIs 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..
Show quote
"Brian" <Br***@discussions.microsoft.com> wrote in message That information is not stored in the JPEG file, at least not overtly. In news:F9D76B8D-7916-43F0-B762-759187378957@microsoft.com... > 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.. 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 |
|||||||||||||||||||||||