v160 · graphics · canvas · webgl · webgpu

One dictionary, three contexts

This feature’s other job is unification. WebGPU always had GPUCanvasToneMapping; the proposal renames it to CanvasToneMapping, moves it into HTML, and hands the same {mode} dictionary to 2D canvas and WebGL. An engine or editor that renders with all three can share one HDR setting. Pick a mode and push it through each API’s own entry point.

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 one setting everywhere

CanvasToneMapping.mode
Each row calls that API’s own tone-mapping entry point with the same dictionary.
contextentry pointreported backresult
2DgetContext("2d", {toneMapping}) → getContextAttributes()not run—
WebGLgl.drawingBufferToneMapping(toneMapping)not run—
WebGPUctx.configure({…, toneMapping}) → getConfiguration()not run—
Pick a mode and apply.

three entry points, one shape

const toneMapping = { mode: "extended" };   // CanvasToneMapping

// 2D (this feature, Blink flag CanvasToneMapping)
canvas2d.getContext("2d", { colorType: "float16", toneMapping });

// WebGL (sibling feature, Blink flag WebGLToneMapping)
gl.drawingBufferToneMapping(toneMapping);  // returns the current value

// WebGPU (shipped as GPUCanvasToneMapping, now the shared dictionary)
gpuCtx.configure({ device, format: "rgba16float", toneMapping });
gpuCtx.getConfiguration().toneMapping;

Each row is a real call. A row reports unsupported when its entry point is missing (no drawingBufferToneMapping, no navigator.gpu or no adapter — WebGPU also needs a secure context and a GPU) and never guesses. WebGL tone mapping is a separate ChromeStatus entry behind --enable-blink-features=WebGLToneMapping; both are also covered by --enable-experimental-web-platform-features.

see also