0

I've used bigtiff library(coming from libtiff to deal with files larger than 4GB) to generate a 8GB image. It can be saved and display successfully, however, it's still to large to be transferred or shared. So I'm trying to compress it with the jpeg support from bigtiff(or libtiff), but it doesn't seem to work for me.

TIFFSetField(out,TIFFTAG_COMPRESSION,COMPRESSION_JPEG);
TIFFSetField(out,TIFFTAG_JPEGQUALITY,30);
TIFFSetField(out,TIFFTAG_JPEGCOLORMODE,JPEGCOLORMODE_RGB);

As above, I set the Jpeg quality tag to 30, and the program can be compiled correctly. However, the result turned out to be a image with jpeg quality equaling to 75 with compression ratio 0.99.

Does anyone have any idea about what's going on here or any suggestions?

Thanks, sunhmy

1 Answers1

0

There is no such thing as a JPEG quality value. Quality settings are simplifications JPEG encoders use to select quantization tables.

One encoder may use a range of 0-100. Another might use 1-8.

You would need to find out what BigTif uses as its range of "Quality" values. It's 30 may well correspond to your 75.

You might want to play around with different values to find out.

user3344003
  • 20,574
  • 3
  • 26
  • 62
  • Thanks for your advice. The thing is it does have a tag called "TIFFTAG_JPEGQUALITY". I've tried to give it different values, but no matter what I give to it, it turned out to be 75. – user3284701 Aug 11 '14 at 23:51