.TIFF
Tagged Image File Format
Introduction
TIFF was created by Aldus in 1986 for desktop publishing and scanners, and passed to Adobe when it bought Aldus. The current baseline specification is TIFF 6.0 from 1992. It is a flexible container: one file can hold several pages, any of a long list of compression methods, high bit depths and many colour spaces, all described by numbered tags.
That flexibility makes TIFF common in print, scanning, archiving, medical and geographic imaging (GeoTIFF). Many camera raw formats, such as DNG and CR2, are built on the same structure. BigTIFF is a variant with 64-bit offsets for files over 4 GB.
Software
- Adobe Photoshop (Windows, macOS)
- GIMP (Windows, macOS, Linux)
- Krita (Windows, macOS, Linux)
- IrfanView (Windows)
- XnView MP (Windows, macOS, Linux)
- ImageMagick (Windows, macOS, Linux)
- QGIS for GeoTIFF (Windows, macOS, Linux)
- LibTIFF (the common library)
Structure
A TIFF file starts with an 8-byte header. The first two bytes give the byte order of
the whole file: II for little-endian (Intel) or MM for
big-endian (Motorola). The number 42 follows, then the offset of the first image file
directory (IFD).
An IFD is a count of entries, then 12 bytes per entry, then the offset of the next IFD (zero for the last). Each entry is a tag number, a data type, a count and either the value itself, when it fits in 4 bytes, or the offset where the value is stored. Tags give the width, height, bits per sample, compression and the offsets and lengths of the strips or tiles that hold the pixels. Each page of a multi-page file has its own IFD.
0Header byte order, 42, offset of the first IFD8 bytes…IFD repeated for each page or imagevaries+0Entry count2 bytes+2Entries tag, type, count, value or offset12 bytes each…Next IFD offset zero at the end4 bytes
…Strips or tiles the image data, found through the tagsvaries