PNG does not store physical image density as a simple mandatory “DPI” number. Its optional pHYs chunk stores pixels per unit on the X and Y axes. When the unit specifier is 1, that unit is the meter. Software can convert pixels per meter into pixels per inch for a familiar PPI display.
If the pHYs chunk is absent, the PNG still has valid pixel dimensions. Its physical print size is simply not specified by that chunk.
What the pHYs chunk contains
The current PNG specification defines three values in pHYs:
- pixels per unit, X axis
- pixels per unit, Y axis
- unit specifier
When the unit specifier is 1, the unit is a meter.
When the unit is unknown, the X-to-Y relationship can still describe pixel aspect ratio, but it does not establish an absolute physical size.
This distinction should be preserved in a DPI checker.
Converting pixels per meter to PPI
One inch equals 0.0254 meter.
Therefore:
PPI = pixels per meter × 0.0254
And the reverse:
pixels per meter = PPI ÷ 0.0254
For 300 PPI:
300 ÷ 0.0254 ≈ 11811.02
A PNG writer that uses integer pixels-per-meter fields will normally store an integer near 11,811 pixels per meter.
Converting 11,811 back:
11811 × 0.0254 ≈ 299.9994 PPI
That tiny difference is normal integer rounding, not evidence of image degradation.
Common PPI conversions
| Intended PPI | Approx. pixels per meter |
|---|---|
| 72 | 2,835 |
| 96 | 3,780 |
| 150 | 5,906 |
| 200 | 7,874 |
| 240 | 9,449 |
| 300 | 11,811 |
| 600 | 23,622 |
The exact displayed result can differ slightly after rounding.
What if X and Y values differ?
If the file carries different horizontal and vertical physical densities, its pixels can imply a non-square physical aspect.
Most modern photographic and web imagery uses square pixels, so equal X and Y density is typical.
A checker should still report both values instead of silently assuming they match.
If the values are suspicious or conflict with the intended use, users can choose a new density during conversion.
Missing pHYs does not mean missing resolution
A PNG can be 4000 × 3000 pixels with no pHYs chunk.
It still has:
- 12 million pixels
- a 4:3 pixel aspect ratio
- enough raster information to calculate possible print sizes at any chosen PPI
At 300 PPI, 4000 × 3000 pixels correspond to about:
13.33 × 10 inches.
At 200 PPI:
20 × 15 inches.
Those are calculated output sizes, not metadata recovered from the file.
Changing PNG density without resampling
If a 3000 × 2400 PNG is tagged for about 300 PPI and you change its density metadata to 150 PPI without resampling, it remains 3000 × 2400 pixels.
Its nominal physical size changes from:
10 × 8 inches at 300 PPI
to:
20 × 16 inches at 150 PPI.
No new detail is added or removed.
Maintaining print size requires new pixels
Suppose the same PNG is intended to remain 10 × 8 inches, but its target density changes from 150 to 300 PPI.
Required dimensions at 150:
1500 × 1200 pixels.
Required dimensions at 300:
3000 × 2400 pixels.
If the source has only 1500 × 1200 pixels, maintaining 10 × 8 inches at 300 PPI requires resampling.
The converter should therefore make “metadata only” and “maintain print size” distinct choices.
Does PNG compression affect DPI metadata?
PNG image data uses lossless compression. The pHYs chunk is separate metadata in the file structure.
Changing or recompressing image data does not inherently require a density change, but an application can decide to omit or rewrite optional chunks when exporting.
That is why round-tripping through different software can change metadata even when the visible pixels appear identical.
PNG for print work
PNG can be useful when a workflow benefits from lossless raster data or transparency.
However, a print provider may prefer TIFF, JPEG, PDF or another format depending on color management, transparency, production software and file-size requirements.
Do not choose PNG solely because it can contain a 300-PPI pHYs value. The provider’s accepted format and color workflow matter too.
Browser display and pHYs
A web browser generally displays an image according to layout dimensions, CSS pixels, intrinsic pixel dimensions and device characteristics. A pHYs value is not a command that forces a 3000-pixel image to occupy a specific real-world number of inches on every screen.
This is another reason “300 DPI for web” is usually the wrong framing. For websites, focus on required raster dimensions, responsive layout, compression and rendering density.
Related entities and semantic terms
PNG, pHYs, pixels per meter, PPI, physical dimensions, raster dimensions, metadata, square pixels, lossless compression, print size.
FAQs
Why does a 300-PPI PNG sometimes display as 299.999 PPI?
PNG stores integer pixels-per-meter values. Converting that integer back to inches can produce a tiny decimal difference because 300 PPI does not map to a perfectly unique integer in pixels per meter.
Can a PNG pHYs chunk specify centimeters directly?
No. The standardized known physical unit in pHYs is the meter. Applications convert that value into inches or centimeters for display.
Can a PNG have meaningful X-to-Y density information without a known physical unit?
Yes. The relative X and Y values can describe pixel aspect ratio even when they do not establish an absolute physical measurement.
Will lossless PNG compression preserve every optional metadata chunk in every editor?
Not necessarily. PNG compression itself is lossless for image data, but an editor or exporter can choose which optional metadata chunks to keep or rewrite.
Closing section
For PNG, the useful mental model is simple: pixels define the raster, while pHYs can describe how densely those pixels map to physical space. Treat pixels-per-meter conversion, missing metadata and actual print placement as separate concepts.
Source and verification notes
The pHYs structure and unit behavior were verified against the W3C PNG Third Edition specification. Conversion values are based on the exact 0.0254-meter definition of one inch.