AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.05.28 06:26 "[Tiff] Tiff last tile problems", by Adell, Albert
2004.05.28 06:26 "[Tiff] Tiff JPEG compression quality factor", by Adell, Albert
2004.05.28 12:18 "Re: [Tiff] Tiff JPEG compression quality factor", by Frank Warmerdam
2004.05.28 17:32 "Re: [Tiff] Tiff JPEG compression quality factor", by Phillip Crews
2004.06.01 08:27 "RE: [Tiff] Tiff JPEG compression quality factor", by Adell, Albert
2004.06.01 18:04 "RE: [Tiff] Tiff JPEG compression quality factor", by Phillip Crews
2004.06.23 07:15 "[Tiff] Tiff JPEG compression quality factor", by Adell, Albert
2004.06.23 10:31 "[Tiff] Tiff JpegCompression 12-bit", by Adell, Albert
2004.05.28 14:35 "Re: [Tiff] Tiff JPEG compression quality factor", by Bob Friesenhahn
2004.05.28 20:57 "Re: [Tiff] Tiff last tile problems", by Andrey Kiselev
2004.06.01 07:59 "RE: [Tiff] Tiff last tile problems", by Adell, Albert

2004.05.28 17:32 "Re: [Tiff] Tiff JPEG compression quality factor", by Phillip Crews

>Hi,
>

I'm using the libtiff v3.6.1 and I can save a tiff file with Jpeg >compression and quality factor 80, but when i

>try to open it, the jpeg quality factor pseudotag has a value of 75. I >guess I am doing something wrong, >because I assume that I can read the Jpeg quality factor written in

>>advance. Is that correct?

Not that I am too knowledgable about this particular area, but my understanding is that the quality "pseudotag" is not really saved with the data. It is just used to drive the compressor. So, when you read a TIFF the value isn't derived from the file, but just set to an initial default value (75).

In short, I don't think you can read the quality factor from an existing image.

I believe Tom Lane provided this method of estimating the Q Factor of a JPEG. It is relatively accurate for images saved using the IJG library:

   int q = cinfo.quant_tbl_ptrs[0]->quantval[6];
   if (q > 51)
     q = (50 * 51 + q / 2) / q;
   else
     q = (5126 - 50 * q) / 51;

- Phillip