Bytes only become a real color once you know which primaries they mix, how bright 1.0 is, whether values use full or narrow range, and whether CICP or ICC is the active authority. Explore each layer visually and copy exact 0.5 Rust code below.
01
Color primaries & out-of-gamut renderings
Click anywhere inside the CIE spectral horseshoe (or pick a test color) to compare how BT.709 / sRGB, Display P3, Adobe RGB, and BT.2020 encode the exact same physical chromaticity — and what happens when wide-gamut colors clip vs soft-compress.
Same physical color rendered across gamuts & policies
Wide-gamut swatches use CSS color(display-p3 ...) / color(rec2020 ...) so P3 displays show true saturation. Notice negative linear RGB channels whenever a color falls outside a smaller triangle.
02
All the HDR things: DiffuseWhite, CLL, ST.2086, HLG & BT.2446A
HDR pipelines break when people confuse five different luminance numbers. Drag the sliders to see where each value sits on the log-luminance ruler and how BT.2446A rolls HDR highlights smoothly into SDR.
Assigns a luminance to relative-linear 1.0. At the ITU BT.2408 anchor of 203 nits, neutral linear 2.0 represents 406 nits. Supply an anchor with with_diffuse_white(...) on ConvertPolicy or .with_diffuse_white(...) on ColorSpace.
PixelBuf::new_signal_white writes nominal signal white for RGB and gray. The PQ endpoint represents 10,000 nits. The display-rendered HLG endpoint represents HlgRendering::peak(). White fill and luminance
ContentLightLevel (MaxCLL & MaxFALL)
MaxCLL = brightest single pixel in the image/stream; MaxFALL = brightest frame-average luminance. Often missing or inflated in real files — ImagePlan can measure pixels with PeakSource::Measured, while streaming RowPlan takes an explicit Option<Nits>.
MasteringDisplay (SMPTE ST 2086 / mDCV)
Describes the grading monitor (primaries, white point, min/max nits like 0.0001–4000 nits) — not the content's actual peak. A 1000-nit movie graded on a 4000-nit Sony BVM still has MaxCLL = 1000.
HlgRendering (BT.2100-3 display OOTF)
HLG is display-adaptive and channel-coupled (Ysγ−1·RGBs), so browsers and monitors render it differently by screen peak Lw, black Lb, and gamma γ. Pass explicit HlgRendering (e.g. REFERENCE_1000_NIT, where 75% signal = 203 nits); display peak is not reused as content peak, and HLG ICC synthesis is refused. Explore HLG display presets & coupled OOTF →
03
Signaling: Narrow vs Full range, and CICP vs ICC
Color signaling travels in container chunks before a single pixel is touched. Getting range or CICP vs ICC precedence wrong silently lifts blacks or double-applies profiles.
Signal range: Full vs Narrow (TV / studio swing)
Narrow range reserves headroom and footroom for broadcast SDI/HDMI. Under default ConvertPolicy::lossless(), zenpixels-convertrefuses silent Narrow↔Full conversions with ConvertError::RangeConversionForbidden instead of relabeling unscaled bytes (which would turn black 16 into dark gray!).
ColorSpace vs ColorOrigin:ColorSpace on PixelFormat is the active authority describing the current pixels in memory. ColorOrigin remembers what the original file claimed (even dual CICP + ICC chunks) for transcoding provenance — and never overrides converted pixels.
04
Live Rust code: primaries, HDR & atomic CICP/ICC output