v160 · graphics · canvas
HDR highlight viewer
The product case: a photo or game viewer drawing a scene whose highlights are brighter than SDR white. The same float16 pixels go into two canvases — one created with toneMapping: {mode: "standard"}, one with "extended". On an HDR display the extended canvas keeps the sun and the top of the ramp brighter than the page’s white; the standard one clamps them to white. Turn the peak up and sample the pixels to see that tone mapping changes the display, never the stored values.
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…
Same pixels, two tone mappings
how it is drawn
const ctx = canvas.getContext("2d", {
colorSpace: "srgb-linear", // linear light: 1.0 = SDR white
colorType: "float16", // store values above 1.0
toneMapping: { mode: "extended" }, // …and display them as HDR
});
ctx.fillStyle = "color(srgb-linear 4 4 4)"; // 4× SDR white
ctx.fill(sunPath);
// "standard": headroom treated as 0 → clamped to SDR white on screen
// "extended": not limited → shown up to the display's HDR headroom
What you can and cannot observe: the stored values and the reflected modes are measured live. Whether the right-hand canvas actually looks brighter is a manual observation — it needs an HDR display, OS HDR mode, and a browser with the feature on. On an SDR display the two canvases are expected to look identical, and that is the correct result. If srgb-linear is not available, the page falls back to srgb (values above 1.0 are still stored in float16) and says so.