Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sesse opened this issue Aug 18, 2022 · 0 comments
Open

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

sesse opened this issue Aug 18, 2022 · 0 comments
Labels
css-color-4 Current Work

Comments

@sesse
Copy link
Contributor

sesse commented Aug 18, 2022

An offshoot from #7610.

We probably need to spec what to do for gamut mapping and WebGL onto a lower-gamut display; right now we say that CSS elements (including SVG) should be mapped using relative colorimetric intent and 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

@svgeesus svgeesus added the css-color-4 Current Work label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-color-4 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants