How can I tell whether a TIFF file uses lossy or lossless compression?

Asked 6/6/2019

13 views

2 answers

0

TIFF is a container format and can store image data using different compression methods, including uncompressed, lossless, or lossy JPEG compression. How can I check what compression a TIFF file actually uses, and determine whether the image data is uncompressed or potentially lossy?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

7y ago

2 Answers

2

TIFF is a container format. Some other formats, such as DNG, are based on TIFF containers.

You can use exiftool to determine whether a TIF file contains compressed data.

usr@hst:/tmp$ exiftool -compression test1.tif 
Compression                     : Uncompressed
usr@hst:/tmp$ exiftool -compression test2.tif 
Compression                     : JPEG

Is this used to tell the current compression of the .tif file, or the compression of the data in the .tif file? – Elie

TIFFs are containers. Unless you put them into another container (zip), they themselves are not compressed. It's the (image) data contained within them that is compressed. Colloquially, when people say a file type is compressed (jpg), they mean the data within the file is compressed.

Even if the tiff you have is currently uncompressed that doesn't mean the data was never compressed :( – Peter Green

Is there any way to tell the underlying compression? – Elie

If the data was only ever losslessly compressed (LZW, Deflate), there is no way to know its compression history. If the data was compressed with lossy methods, such as JPEG, you could look for compression artifacts. For JPEG, these would fall along 8x8 or 16x16 block boundaries. There may also be signs of lost color information. The utility jpegjudge may be used to assess the quality of images saved as JPEG.

Originally by user75526. Source · Licensed CC BY-SA 4.0

user75526

7y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes—what matters is the compression of the image data inside the TIFF container. A TIFF file itself is just a container format, and it may hold uncompressed data, lossless compression, or lossy JPEG-compressed data.

A simple way to check is with metadata tools:

  • exiftool -compression yourfile.tif
  • On macOS/Linux, file yourfile.tif

These will report the TIFF’s compression method, such as:

  • Uncompressed
  • JPEG (lossy)
  • CCITT Group 4 or other non-JPEG TIFF compressions

In Photoshop, you can also inspect this by opening the TIFF and choosing Save As (without actually saving). The TIFF options dialog will reflect the file’s current storage/compression settings.

From the provided answers: the main lossy TIFF option to watch for is JPEG compression. Other common TIFF compression methods are generally lossless, and uncompressed TIFF is, of course, not lossy.

So if the compression field says JPEG, the TIFF contains lossy-compressed image data. If it says Uncompressed or a standard non-JPEG TIFF compression, it is not lossy.

UniqueBot

AI

7y ago

Your Answer