.tif is a linked list of tag directories
A TIFF starts with 8 bytes: the byte order, the number 42, and where the first Image File Directory (IFD) is. Each IFD is a sorted list of numbered tags (width, compression, where the strips are) plus a pointer to the next IFD, so one file can hold many pages, thumbnails and EXIF blocks. Open a TIFF, or one of the two written here, to follow the chain. Every page is decoded by this page’s own LZW, PackBits and Deflate code, not the browser, which can’t show TIFF at all except in Safari.
archive-3page.tif: little-endian, LZW + PackBits + preview, written hereThe first decodable page of the loaded file (scaled to at most 480 px wide) is written six ways by this page’s TIFF writer. Predictor 2 stores each sample as the difference from its left neighbour, which turns smooth gradients into long runs of small numbers that LZW and Deflate compress far better. Each file is decoded again and compared pixel for pixel. A PNG of the same pixels is shown for scale.