[csswg-drafts] [css-color-4] Need to specify intent for <canvas> and WebGL (#7621)

sesse has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-color-4] Need to specify intent for <canvas> and WebGL ==
An offshoot from https://github.com/w3c/csswg-drafts/issues/7610.

We probably need to spec what to do for gamut mapping <canvas> and WebGL onto a lower-gamut display; right now we say that CSS elements (including SVG) should be mapped using relative colorimetric intent and <img> should be mapped using perceptual intent, but we need to nail down what intent to use for a canvas or WebGL content (or even if that should be possible for the author to request when creating the context).

My intuition would be something like this (where 1 and 4 are already specified as such in the spec):

1. DOM elements (incl. SVG): Relative colorimetric.
2. Canvas: Relative colorimetric.
3. WebGL: Perceptual.
4. <img>, <video>, etc.: Perceptual. (Unless there is an ICC profile that says something else?)

The reasoning is that canvas is usually for 2D graphics and WebGL is usually for 3D graphics. I don't have very strong opinions here, we just need to figure out something. My hunch is that if an author is super-unhappy about this, they shouldn't be creating a WCG context without first checking that the display can handle it.

I'm not sure whether background-image: in CSS should be treated as 1 or 4. I could be swayed either way.

We _also_ need to specify what happens when drawing with an out-of-gamut color _onto_ a canvas; I would suppose “the same rules as everywhere else” (ie., relative colorimetric for drawing lines etc., perceptual for images).

@weinig @svgeesus 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7621 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 18 August 2022 12:46:47 UTC