v160 · graphics · canvas + css

dynamic-range-limit interplay

Two knobs decide how bright a canvas gets. The script knob, toneMapping.mode, says whether the bitmap is HDR at all. The style knob, the CSS dynamic-range-limit property, caps how much of the display’s headroom any HDR content in an element may use — for canvas exactly as for <img> and <video>. The explainer is explicit: an "extended" canvas under dynamic-range-limit: standard displays the same as a "standard" one. Combine them and see the computed values and the expected result.

Shipping status & how to enable. Chrome 160 is planned to ship this enabled for everyone. Until then it sits behind the Blink runtime feature CanvasToneMapping (status experimental in runtime_enabled_features.json5). To run it today in Chrome or Canary: turn on chrome://flags/#enable-experimental-web-platform-features (there is no dedicated chrome://flags entry), or launch with --enable-blink-features=CanvasToneMapping. Seeing brighter-than-white pixels additionally needs an HDR-capable display and OS HDR mode — this page reports (dynamic-range: high) so you know which case you are in.

Probing this browser…

Apply a limit to both canvases

dynamic-range-limit on the <canvas> elements
mode: standard
mode: extended
Loading…
Expected on an HDR display (spec + explainer). The highlighted row is the current limit.
dynamic-range-limitmode: standardmode: extended
no-limitSDR (headroom 0)full display headroom
constrainedSDR (headroom 0)a little HDR headroom (UA-chosen, mixes with SDR UI)
standardSDR (headroom 0)SDR — identical to mode: standard
mix(standard 50%, no-limit 50%)SDR (headroom 0)between SDR and full headroom

the rule

/* Presented headroom = min(bitmap headroom, headroom it was tone mapped to)
   bitmap headroom:  "standard" → 0      "extended" → not limited
   tone-mapped-to:   display headroom, limited by dynamic-range-limit */
canvas.hdr-thumbnail { dynamic-range-limit: standard; }   /* grid of thumbnails */
canvas.hdr-viewer:focus-within,
canvas.hdr-viewer:hover { dynamic-range-limit: no-limit; } /* the one you inspect */

The practical pattern: create every canvas with "extended" once, and let CSS decide where HDR is allowed (a focused viewer, not a whole grid of thumbnails competing with the UI). Because dynamic-range-limit is an ordinary CSS property it can change on hover, focus, or by media query without recreating any context — whereas toneMapping is fixed at getContext time.

Observation note: the computed value and the reported modes are live measurements. The brightness difference is a manual observation on an HDR display; on SDR displays every cell of the table renders as SDR.

see also