TIFF DPI — what's stored, what reaches the PDF
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
- XResolution (tag 282): horizontal resolution as a rational number (numerator / denominator). Example: 300/1 means exactly 300 units; 720/3 means exactly 240 units.
- YResolution (tag 283): vertical resolution, same format. Usually equal to XResolution but may differ for unusual scanners.
- ResolutionUnit (tag 296): the unit. Value 2 = inch, value 3 = centimeter, value 1 = "no absolute unit" (relative aspect only).
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:
- Missing tags: TIFF files generated programmatically without setting resolution.
- ResolutionUnit = 1 (none): image with relative-only resolution.
- DPI < 50 or > 1200: typically a unit confusion (DPI stored as DPCM, 100 DPI fooled into looking like 30, etc.).
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:
- In bilevel fax-derived TIFFs, where horizontal and vertical resolutions historically differed (200 × 100 was a common fax mode).
- In scanners with non-square pixel arrays.
- In intentionally anamorphic content (rare).
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:
- Printing. A "print at 100%" produces a paper copy the same size as the original.
- Reading on screen. A reader at 100% zoom shows the document at its true physical size — important for proofreading or visual comparison with another physical copy.
- Audit and discovery. Legal contexts often require the digital copy to "be" the document at original scale.
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:
- European A5 (148 × 210 mm) and A6 (105 × 148 mm) — small, but exists.
- US Legal (8.5 × 14 in) — common in legal/courthouse scans.
- European checks (171 × 78 mm) and other non-standard small documents.
- Photograph scans at 4×6, 5×7, 8×10 inches.
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.