← Blog

PNG color profiles — iCCP, sRGB chunk, and how PDF handles them

PNG has four ways to specify color; PDF preserves them via /ICCBased or /DeviceRGB PNG color-specification chunks iCCP — embedded ICC profile (any color space) sRGB — single-byte declaration: "this is sRGB" + intent gAMA — gamma value (e.g. 0.45455 = sRGB-like 2.2) cHRM — chromaticity coordinates of RGB primaries + white point Typical PDF mapping iCCP → /ColorSpace [/ICCBased N R] (full profile preserved) sRGB only → /DeviceRGB (PDF assumes sRGB by default) gAMA + cHRM → could synthesize an ICC profile, rare in practice The conversion pipeline relies on a standard PDF library to embed the PNG.

Like JPEG, PNG can carry a color profile that tells viewers exactly which "red" pixel value 255,0,0 represents. Unlike JPEG, PNG offers four different mechanisms: an embedded ICC profile, a "this is sRGB" flag, a gamma value, and a chromaticity declaration. Most PNGs in the wild have none of these — and that absence has well-defined fallback behavior.

The iCCP chunk — full ICC profile

The recommended modern approach. The PNG carries a complete ICC profile as a binary blob in the iCCP chunk, identical in format to ICC profiles embedded in JPEGs and TIFFs. The profile fully describes the color space's gamut, gamma, and white point.

iCCP is what tools like Photoshop, Lightroom, and modern phone cameras write when they save PNGs in non-sRGB color spaces (Display P3, Adobe RGB, ProPhoto RGB).

When the source PNG carries iCCP, the resulting PDF preserves it: PDF maps the embedded ICC profile to /ColorSpace [/ICCBased N R], with the profile bytes living as a separate compressed stream object. Profile-aware PDF readers render the colors faithfully.

The sRGB chunk — "this is sRGB"

Added in PNG 1.1 (1998). A single-byte chunk that says "this image is in sRGB color space" plus a one-byte rendering intent (perceptual / relative colorimetric / saturation / absolute colorimetric).

This is ~500 bytes smaller than embedding a full sRGB ICC profile (which is around 3 KB) and faster to parse. For the 95%+ of PNGs that are in sRGB, it's the right choice.

PDF doesn't have an exact equivalent. The closest match is /DeviceRGB, which PDF readers conventionally interpret as "render with the output device's default RGB" — almost always sRGB on consumer devices. PNGs that declare sRGB but carry no full ICC profile typically end up as /DeviceRGB in the output PDF.

For strict color management (PDF/A archival, print prepress), /DeviceRGB is too vague — the spec requires an explicit profile reference. In those cases, embed an sRGB ICC profile via /ICCBased after conversion. The conversion pipeline doesn't synthesize one for you.

The gAMA chunk — just the gamma

An older mechanism, predating ICC profiles. Stores a single floating-point gamma value (typically 1/2.2 ≈ 0.45455). The PNG decoder is instructed to apply this gamma when displaying the image.

gAMA-only PNGs are mostly historical — produced by tools from the 1990s. Modern viewers handle them correctly but treat them as sRGB equivalents (the math is roughly the same).

gAMA-only PNGs typically end up as /DeviceRGB in the output PDF. The visual result is indistinguishable from a strict gamma interpretation on consumer displays.

The cHRM chunk — primaries and white point

Specifies the (x, y) chromaticity coordinates of the red, green, blue primaries and the white point. With cHRM + gAMA, an image can fully describe a non-standard color space without an ICC profile.

Rare in practice. Photoshop and other modern tools write iCCP instead. cHRM is more often seen in screenshots from systems that don't bother with ICC machinery.

cHRM-only PNGs typically end up as /DeviceRGB in the output PDF. A more sophisticated pipeline could synthesize an ICC profile from cHRM + gAMA values, but this isn't done automatically.

No color chunks at all — the implicit default

A PNG with none of iCCP, sRGB, gAMA, or cHRM is "untagged". By convention dating to PNG 1.0, untagged PNGs are interpreted as sRGB by all major viewers and operating systems. This works because sRGB is the de facto color space of consumer displays.

Untagged PNGs end up as /DeviceRGB in the output PDF. Output looks identical to input on the same display.

When ICC matters — the Display P3 case

Modern macOS, iOS, and Windows ARM machines have wide-gamut displays. When you take a screenshot on such a system, the OS saves a Display P3 PNG with an embedded iCCP profile.

If you embed this PNG into a PDF without preserving the profile, the PDF Image XObject carries Display P3 pixel values labeled as /DeviceRGB. PDF readers interpret those wide-gamut RGB values as sRGB and clip them — your saturated reds and greens look washed-out and slightly wrong.

The conversion preserves the iCCP profile for Display P3 (and other tagged) PNGs: the resulting PDF carries the original profile via /ICCBased and profile-aware viewers render correctly.

How to check a PNG's color information

Open the PNG in a photo editor or image viewer (Photoshop, Preview on Mac, Windows Photos via Properties → Details). The "Image Properties" or "Color Profile" panel reports the embedded profile name (e.g. "Display P3", "sRGB IEC61966-2.1") or notes that the file is untagged. On macOS, "Get Info" on a PNG file shows basic color-profile information.

Output PDF — what color profile it gets

The conversion does not add a document-level OutputIntent (the PDF/A-required color profile that describes the document's intended display). The PDF is suitable for general-purpose viewing but not strictly compliant with PDF/A-2 or PDF/X-3 archival standards.

For strict archival, post-process with a tool that adds an OutputIntent: ghostscript -dPDFA=2 or veraPDF's transformer.