← Blog

TIFF DPI — what's stored, what reaches the PDF

TIFF stores DPI in three tags; TIFF2PDF uses them to size the PDF page TIFF resolution tags XResolution (282) e.g. 300/1 YResolution (283) e.g. 300/1 ResolutionUnit (296) 2 = inch, 3 = cm XResolution and YResolution are rationals (numerator / denominator), giving exact ratios like 300/1 (=300 DPI) or 720/3 (=240 DPI) PDF page size derivation page_width_pt = pixel_width / DPI × 72 page_height_pt = pixel_height / DPI × 72 at 300 DPI, 2550×3300 pixel scan → page = 612 × 792 pt → US Letter exactly at 600 DPI, 4960×7016 pixel scan → page = 595 × 842 pt → A4 exactly

Unlike PNG and JPEG (where DPI is largely advisory and often missing or wrong), TIFF treats resolution as a first-class image property. Every well-formed TIFF declares a precise DPI in its tags, and that DPI typically matches the original scan setting. TIFF2PDF reads it and uses it to set the PDF page size to match the original physical dimensions.

The three resolution tags

The rational format avoids floating-point ambiguity. Non-integer DPIs like 300.0001 don't appear in well-formed TIFFs; you get 600/2 = exactly 300, or 1800/6 = exactly 300, etc.

How TIFF2PDF maps DPI to page size

For each TIFF page, TIFF2PDF reads pixel dimensions and resolution tags, then computes:

page_width_pt  = pixel_width  / DPI_x × 72
page_height_pt = pixel_height / DPI_y × 72

If both DPI values are reasonable (between 50 and 1200), the PDF page is sized to the computed dimensions. A 2550 × 3300 scan at 300 DPI produces a 612 × 792 pt page = US Letter. A 4960 × 7016 scan at 600 DPI produces a 595 × 842 pt page = A4.

The result is a PDF whose pages, when printed at 100% scale, exactly match the physical original. This is the right behavior for archival of scanned documents.

When DPI is missing or wrong

Some TIFFs lack ResolutionUnit or have nonsense values:

For these cases, TIFF2PDF falls back to A4 portrait and fits the image preserving aspect ratio (computing a synthetic DPI as for JPG and PNG). The page size is "reasonable for viewing" rather than "matches the physical original".

Different X and Y resolutions

Most scans have XResolution = YResolution. Different values appear:

Known limitation: when X and Y resolutions differ (non-square DPI), the converter averages them and applies the same DPI to both axes. Anamorphic content is therefore rendered with the average DPI in both directions, which means a 200×100 DPI fax-resolution scan ends up displayed at the average of 150 DPI on both axes — the aspect ratio of the original physical page is not preserved. For correct anamorphic rendering, normalize the TIFF's resolution before upload (resample to square pixels in any image editor: GIMP's "Image → Scale Image" with the same target DPI for both axes does this).

Centimeter units

Some European scanners (and some scientific imaging tools) store resolution in centimeters: ResolutionUnit = 3, XResolution = 118 (118 DPCM = 300 DPI). Same image, different unit.

TIFF2PDF converts: DPI = DPCM × 2.54. Internal computation is always in DPI; the conversion is exact.

Why physical sizing matters for archives

For office documents, a faithful reproduction at original size has practical value:

This is why TIFF2PDF prefers TIFF's stated DPI over a fitted-to-A4 layout. The TIFF format was designed for archival; its DPI is reliable; PDFs derived from it should preserve the contract.

When a TIFF page isn't a standard paper size

Some scanned originals don't match standard paper:

TIFF2PDF produces PDF pages of those exact dimensions. No automatic snapping to "nearest standard paper". This is correct behavior — a 5×7 photo scan should produce a 5×7 PDF page, not an A4 page with a small photo on it.

Checking a TIFF's DPI

Open the TIFF in any image editor (Photoshop, GIMP, Preview on Mac) and look at "Image Properties", "File Info", or "Image Size" — the dialog reports pixel dimensions and DPI together. On Windows, right-click → Properties → Details shows DPI (called "Horizontal resolution" / "Vertical resolution"). Typical readouts are "2550 × 3300, 300 × 300 DPI" for a Letter-sized scan.