Expand description
Embedded CC0-licensed ICC profiles for common wide-gamut color spaces.
The four compact constants are from Compact-ICC-Profiles
by Clinton Ingram, released under the CC0 1.0 Universal
public domain dedication. They are embedded at compile time via include_bytes!().
The full icc-db CICP database is generated separately; it is not this
collection of compact constants.
§Available profiles
| Constant | Color space | Format | Size | TRC form |
|---|---|---|---|---|
DISPLAY_P3_V4 | Display P3 | ICC v4 | 480 bytes | paraType-3 sRGB |
DISPLAY_P3_V2 | Display P3 | ICC v2 | 736 bytes | 182-point sampled sRGB |
ADOBE_RGB | Adobe RGB (1998) | ICC v2 | 374 bytes | curv count=1 (pure gamma) |
REC2020_V4 | Rec. 2020 | ICC v4 | 480 bytes | paraType-3 BT.709 |
§Notes on choices
§Adobe RGB — pure gamma, not paraType-3
We deliberately bundle the saucecontrol v2 variant (curv count=1,
gamma 2.19921875, no linear toe) rather than their v4 variant
(paraType funcType=3 with linear toe). Rationale: surveying the in-the-wild
corpus, ~85% of Adobe RGB ICC profiles encode the TRC as pure gamma
(Adobe CS4 distribution, Windows ClayRGB1998 / AdobeRGB1998, macOS
AdobeRGB1998, Linux AdobeRGB1998/compatibleWithAdobeRGB1998, Nikon,
and per-camera profiles). The Adobe RGB 1998 encoding spec (§4.3.4.2)
itself defines pure gamma with no toe. Bundling the pure-gamma form
matches both the spec and the majority of the ecosystem, and means the
embedded profile round-trips byte-exact against moxcms’s new_adobe_rgb()
canonical reference.
§ProPhoto — not bundled
Unlike Adobe RGB, real-world ProPhoto / ROMM ICC profiles are fragmented:
~50% pure gamma 1.8, ~30% paraType funcType=3 with the ISO 22028-2 toe
(c=1/16, d=1/32), some with a non-standard Apple d=1/512, one
ProPhotoLin.icm with a linear TRC despite the name, and two ISO 22028-2
v4 profiles that are mAB/mBA LUTs (no rTRC at all). Picking any single
“canonical” ProPhoto profile to embed would misrepresent the other
variants. Instead we leave ProPhoto un-accelerated: callers handing us a
ProPhoto ICC profile fall through to full CMS so the exact encoded curve
is honored.
§Display P3 / Rec. 2020 — compact constants, not what synthesis emits
The DisplayP3Compat and Rec2020Compat profiles use saucecontrol’s
compatibility rebalancing: the adapted red primary’s negative Z is set to
zero, with other colorants and chad adjusted to compensate. This changes
the represented colorimetry, and these constants carry no cicp tag.
ICC.1:2022 permits negative PCSXYZ in signed s15Fixed16Number XYZType
colorant tags (and float32 multiProcessElementsType); retaining such a
value is spec-conformant. Older ICC wording and reader behavior motivated the
separate compatibility variants. See the linked correctness overview below.
Some readers identify a gamut by colorant tags within a tolerance:
our libultrahdr colorant-matching regression (0.001 tolerance) rejects
DISPLAY_P3_V4 as an exact P3 match. P3 synthesis uses separately qualified
compact P3/sRGB and P3/BT.709 exports in both default and no-db builds.
Other database-supported pairs use the generated CICP-tagged bundle.
Compatibility constants remain available for callers selecting them explicitly.
Profile format, colorimetry, precision and reader compatibility are separate checks: https://github.com/imazen/zenpixels/blob/review/first-class-lcms-20261108/docs/color-correctness-and-compatibility.md.
§Precision warnings
Rec. 2020 has a very wide gamut. Using 8-bit precision with Rec. 2020 will cause visible banding in gradients. Use 16-bit or f32 precision.
Enums§
- Synthesized
Icc - Outcome of
SynthesizedIcc::for_cicp— what ICC profile (if any) to embed for a CICP color description, and why there are no bytes when there aren’t.
Constants§
- ADOBE_
RGB - Adobe RGB (1998) Compatible ICC profile, v2 format (374 bytes, pure gamma).
- DISPLAY_
P3_ V2 - Display P3 Compatible ICC profile, v2 format (736 bytes).
- DISPLAY_
P3_ V4 - Display P3 Compatible ICC profile, v4 format (480 bytes).
Functions§
- bundled_
icc_ profile - Get a bundled
&'staticICC profile whose tone curve is exactly the requested transfer function on exactly the requested primaries.