WICG / canvas-color-space

Proposed web platform feature to add color management, wide gamut and high bit-depth support to the <canvas> element.
Other
81 stars 19 forks source link

Clarify extended values and high dynamic range behavior #39

Closed ccameron-chromium closed 3 years ago

ccameron-chromium commented 3 years ago

Clarify extended values and high dynamic range behavior

Address the outstanding issue of how to handle floating point pixel values outside of the range of [0, 1]. Define these color values in the usual way (similar to, e.g, kCGColorSpaceExtendedSRGB and DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 on macOS and Windows respectively).

Indicate that values outside of [0, 1] always extend the gamut beyond the canvas' color space's primaries (there is no artifical clamping).

Add a highDynamicRange creation attribute that controls whether or not values outside of [0, 1] can extend the luminance of the canvas.

Leave as an open issue how HDR metadata is to be specified (it is likely desirable for it to be dynamic) for now.

ccameron-chromium commented 3 years ago

This clarifies the meaning of pixel values outside of the range of [0, 1].

I added the highDynamicRange property because I feel it is import to clarify under what circumstances color values aren't to be clamped. Let me know if you'd prefer to remove this property for now, and just specify that "luminance will be clamped, but chrominance won't, unless otherwise specified"