TIFF

TIFF — the Tagged Image File Format — is less a file format than a container with a very long memory. A .tif file can hold a fax, a scanned page, a 16-bit CMYK press image, a satellite tile, a microscope slide of several gigabytes, or a high-dynamic-range render in device-independent CIE XYZ. Paintapp reads all of those.

This page covers what TIFF is, where it came from, why it is still everywhere, and exactly which parts of it Paintapp supports.

A Little History

TIFF was created in 1986 by Aldus, the company behind PageMaker, at a moment when desktop publishing was being invented and every scanner vendor shipped its own incompatible file format. Aldus wanted one format that a page-layout program could read no matter which scanner produced it. Microsoft collaborated on the early revisions.

Revisions came quickly — version 3 in 1988, version 5 later that year adding palettes and LZW compression — and then TIFF 6.0 arrived in June 1992. That document is, remarkably, still the baseline specification more than three decades later. Adobe acquired Aldus in 1994 and has been the format's custodian ever since, amending 6.0 through a series of Technical Notes rather than ever shipping a version 7.

The second field of every TIFF file is the number 42. The 6.0 specification explains the choice without embarrassment: it is "an arbitrary but carefully chosen number" selected "for its deep philosophical significance" — a nod to The Hitchhiker's Guide to the Galaxy. BigTIFF, which came later, uses 43.

Why "Tagged"?

Most image formats define a fixed header: so many bytes of width, then height, then pixels. TIFF instead stores a directory of tags. Each tag is a numbered field with a type, a count, and either a value or a pointer to one. Width is tag 256. Compression is tag 259. The pixels themselves live wherever a tag says they live.

This is why TIFF outlived its contemporaries. A new capability — a color profile, a GPS coordinate, a compression scheme invented in 2015 — is just a new tag number, and readers that do not understand it skip over it. Almost nothing is mandatory, almost everything is optional, and a file may contain several images chained together as a linked list of directories.

The same flexibility is the format's curse. A conforming TIFF writer and a conforming TIFF reader can fail to understand each other completely, because each implements a different subset. The format has long been known by an affectionate backronym: Thousands of Incompatible File Formats. The specification itself tried to contain the damage by defining a small mandatory "Baseline TIFF" and relegating everything else to "Extensions" — a distinction most real files cheerfully ignore.

How a TIFF is Laid Out

AspectDetail
Byte orderDeclared by the first two bytes: II for Intel (little-endian) or MM for Motorola (big-endian). Both are equally valid, and both are common in the wild.
DirectoriesAn Image File Directory (IFD) is a sorted array of tags. Each IFD points to the next, so one file can hold many images — pages of a fax, frames, or pyramid levels.
Pixel layoutPixels are broken into horizontal strips or rectangular tiles. Tiles suit huge images, because a reader can fetch one region without decoding the rest.
Channel layoutChunky (interleaved RGBRGB…) or planar (all red, then all green, then all blue). Paintapp reads both.
BigTIFFA 2007 extension using 64-bit file offsets, lifting the 4 GB ceiling. It announces itself with version 43 instead of 42. Paintapp reads BigTIFF in both byte orders.

Its Place Today

You will never see a TIFF on a web page — no browser decodes one natively, and it was never designed for a network. Yet it remains the default in nearly every field where an image has to survive, be measured, or be printed:

FieldWhy TIFF
Archives and preservationNational libraries and archives specify uncompressed or losslessly-compressed TIFF as the master format for digitized collections. It is old, fully documented, and needs no living vendor.
Print and prepressNative CMYK with an embedded ICC profile, at 8 or 16 bits. The ISO 12639 TIFF/IT profile standardized it for the printing industry.
Scanning, fax, documentsBilevel CCITT Group 3 and Group 4 compression came straight from the fax standards. A multi-page TIFF is still how many scanners deliver a document.
Camera rawThis is the quiet one. Adobe's DNG is a TIFF, and so are most proprietary raw formats — Nikon NEF, Canon CR2, Sony ARW. They are TIFF containers with private tags, built on the ISO 12234-2 TIFF/EP profile. If you shoot raw, you use TIFF every day without seeing one.
GeospatialGeoTIFF adds georeferencing tags; the modern Cloud-Optimized GeoTIFF arranges tiles and overviews so a client can fetch one map square over HTTP without downloading terabytes.
Science and medicineMicroscopy (OME-TIFF, ImageJ) and digital pathology rely on tiled BigTIFF to store single slides of many gigapixels.

Compression

Paintapp decodes every one of these:

SchemeNotes
UncompressedStill the archival default.
PackBitsApple's simple run-length scheme, from the Macintosh toolbox.
LZWAdded in TIFF 5.0 (1988). The Unisys patent that made GIF notorious in the 1990s covered this too; it expired worldwide by 2004. Paintapp also handles the rare non-conformant "old-style" LZW variant that packs its codes the other way round.
Deflate / ZIPThe same algorithm as PNG and .zip, plus an obsolete tag number that older writers used.
CCITT Group 3 and Group 4Bilevel fax coding, taken from ITU-T recommendations T.4 (1980) and T.6 (1984). Group 4's two-dimensional coding still beats general-purpose compressors on scanned text.
JPEGThe modern form, defined by Adobe's Technical Note 2 (1995): each strip or tile is a self-contained JPEG.
Old-style JPEGThe withdrawn original. See below — it is a small archaeology project of its own.
ThunderScanA 4-bit run-length format from an early Macintosh scanner cartridge.
PixarLogAn 11-bit logarithmic encoding from Pixar's rendering pipeline, deflate-compressed. It stores far more highlight detail than 8-bit for the same size.
SGI LogL and LogLuvSilicon Graphics' high-dynamic-range encodings. See below.
LZMA, Zstandard, WebPModern additions, mostly from the GDAL and geospatial world.

Color Models

TIFF calls this the photometric interpretation — a tag that says what the numbers in each pixel actually mean. Paintapp reads the following.

PhotometricWhat it is
WhiteIsZeroBilevel or grayscale where 0 means white. It looks like a mistake and is not: it is the fax convention, inherited from a world where a zero bit meant "no toner".
BlackIsZeroOrdinary grayscale.
RGBWith or without an alpha channel.
PaletteIndexed color. The index may be up to 16 bits wide, so a colormap can hold 65536 entries — a scale no other palette format contemplates.
Separated (CMYK)Ink coverage rather than light, at 8 or 16 bits. The reason TIFF owns prepress.
YCbCrLuma and chroma, optionally with the chroma channels stored at reduced resolution. This is what JPEG-compressed TIFFs contain.
CIELab, ICCLab and ITULabPerceptual color, independent of any device. Three photometrics, one color space — see below.
LogL and LogLuvHigh dynamic range. See below.

Why are there three Lab photometrics?

Because they are not three color spaces. CIELab (photometric 8), ICCLab (photometric 9) and ITULab (photometric 10) all mean CIE 1976 L*a*b* measured against a D50 white point. Identical color, identical meaning. They differ only in how the three numbers are packed into bytes on disk.

L* runs from 0 (black) to 100 (white), so it fits naturally into an unsigned channel. The trouble is a* and b*, which describe the green–red and blue–yellow axes and run through zero, roughly −128 to +127. There is more than one way to store a signed quantity in an image channel, and TIFF ended up collecting all of them:

CIELab (8)ICCLab (9)ITULab (10)
a* and b*Stored signed: neutral gray is 0, and negative values wrap into the top of the range.Stored offset: 128 is added first, so neutral gray sits in the middle of the range and nothing is negative.Stored offset and scaled: the file states, in a tag, the exact minimum and maximum value each channel spans.
Where it comes fromTIFF 6.0, section 23.The ICC profile specification, brought into TIFF by Adobe's Technical Note 4.ITU-T Recommendation T.42, brought into TIFF by TIFF-FX (RFC 2301) — the standard for color fax.
Who writes itPhotoshop.Color-management tooling that already speaks ICC.Color fax machines, and the scanners that pretend to be one.
Sample depths8 or 16 bits. Chroma at 16 bits is a signed value at 256× scale.8 or 16 bits. The 16-bit form is the legacy ICC v2 encoding, in which L* = 100 lands on 0xFF00 rather than 0xFFFF.8 or 12 bits. Never 16.

The ICC v2 row is one sharp edge. Because that older 16-bit encoding does not use the full range of the channel, converting between the two forms is not simply a matter of adding or subtracting 128 — the values must also be rescaled, or every color in the image shifts slightly.

ITULab is the other. Rather than fix a convention, it carries one: a Decode tag lists the minimum and maximum L*, a* and b* that sample values 0 and 2n−1 stand for, and the decoder interpolates between them. When the tag is absent, T.42's own defaults apply — and they are not symmetric. At 8 bits a* spans −85.3 to +84.7 while b* spans −75.3 to +124.7, so a* is neutral at sample 128 but b* is neutral at sample 96. Fax gets more yellow than blue because paper is white and ink is black, and the encoding was built to spend its bits where documents actually live.

Paintapp reads all three photometrics — CIELab and ICCLab at 8 and 16 bits, ITULab at 8 and 12, honoring Decode — and normalizes them to one internal representation.

LogL and LogLuv

In 1998 Greg Ward, at Silicon Graphics, asked what a really honest image encoding would look like if it had to describe the world rather than a monitor. The answer was LogLuv: store luminance logarithmically, because human vision responds to ratios rather than differences, and store chromaticity separately. The 32-bit form covers roughly 38 orders of magnitude of luminance — from starlight to the sun — inside the same four bytes an ordinary RGBA pixel occupies.

LogL is the grayscale sibling, carrying luminance alone. Paintapp decodes both to scene-linear floating point. LogLuv is not an RGB space at all: it is device-independent CIE XYZ, covering the entire visible gamut, so it is tagged as such and converted through the color-management pipeline rather than assumed to be sRGB.

Old-style JPEG: a Cautionary Tale

TIFF 6.0's section 22 defined how to put JPEG inside a TIFF, and got it badly wrong. It scattered the JPEG stream's own header — its quantization and Huffman tables, its frame description — across a set of TIFF tags, leaving the strips holding raw entropy-coded data with no JPEG markers in them at all. A reader had to reassemble a valid JPEG from the tags before it could decode a single pixel.

Almost nobody implemented it identically. Adobe withdrew the design and replaced it in 1995 with Technical Note 2, which simply puts a complete little JPEG in each strip. The old scheme — compression 6, "old-style JPEG" — survives only in files written during those three years, which is precisely why it still has to be supported.

It came in two flavours, and Paintapp reads both: the ordinary lossy baseline process, and the rare lossless process, a predictive scheme with no quantization at all that reconstructs the original samples exactly.

Bit Depths and Precision

TIFF does not limit you to 8 bits. Paintapp reads 1, 2, 4, 6, 8, 10, 12, 14, 16, 24 and 32 bits per sample as integers, and 16-, 24- and 32-bit IEEE floating point. The odd depths are not curiosities: 10, 12 and 14 bits are what camera sensors actually produce.

Two predictors are supported. Horizontal differencing stores each pixel as the difference from its neighbor, which turns a smooth gradient into a long run of near-zero values and can dramatically improve LZW or Deflate. A separate floating-point predictor does the same trick byte-plane by byte-plane for float images.

Alpha is declared through the ExtraSamples tag, which distinguishes associated alpha (premultiplied) from unassociated alpha — a distinction most formats leave dangerously implicit.

Metadata

Paintapp reads the embedded ICC color profile and honors it, along with the descriptive tags: document name, artist, software, copyright and image description. Embedded EXIF, XMP and IPTC blocks are read as well, and appear in File Info and in the File Browser's metadata columns.

Writing TIFF

Work in progress. Paintapp's TIFF reader is broad; its writer is not, and is best treated as unfinished. Everything on this page above describes reading.

Export currently produces 8-bit RGB only, as a single uncompressed or run-length-encoded strip, in either byte order. Of the compression choices offered in the export dialog, only None and RLE actually write a file — and ZIP, presently the default, does not work at all. Choose one of the other two until this is finished.

Not yet written: LZW and JPEG compression, 16-bit and floating-point samples, CMYK, grayscale, Lab, tiles, multiple strips, and multi-page files. None of this limits what Paintapp can open.

Known Limitations

These are the corners Paintapp does not currently reach when reading. Unsupported files report a specific error rather than opening as a blank image.

See Also