0
votes

I built the tiff library from source including zlib and jpeg compression options. I can save with either compression type depending if I want lossless images at a higher file size, or smaller file sizes but lossy images.

The issue I have is, how do I control the JPEG quality? The program I wrote wants to be able to create both, and change the image quality when using JPEG compression. I expected there to be a tiff tag where the quality can be set, but I have yet to find that when searching. I would like to try a few different qualities between 50 and 100.

The TIFF image container must be used, so I cannot just use libjpeg directly to make JPEG images.

1

1 Answers

0
votes

I search the whole TIFF source code and found the tag TIFFTAG_JPEGQUALITY that allows the setting of the JPEG quality, using an int between 0 and 100. I tested it and it does in fact change the quality.

I searched the TIFF tags website and this tag is not listed as a valid tag, but it supported natively by the latest version.