Re: [csswg-drafts] [css-color-4] Channel clipping breaks author expectations, especially when using 'perceptually uniform' spaces (#9449)

> A gamut mapping algorithm that prioritizes chroma does cause issues for end users, like insufficient contrast, as this issue initially described.

That was my understanding as well. It is really the issue that I think needs to be settled. What is the real end goal for users? Is this goal shifting?

I've now seen the actual chromium code that currently does the gamut mapping. This means I can experiment with it more directly now.

It does try to provide a kind of middle ground. I know this has been explained in earlier posts, but in its current form, it approximates to the Rec. 2020 gamut, and then seems to just allow clipping to anything below. This kind of shrink wraps the Rec. 2020 gamut on the smaller gamuts. Chroma reduction, as generally described by the CSS spec in its current form, will find a more accurate hue, but it may be greatly diminished as the target gamut may not be able to come anywhere close to the colorfulness requested.

Below, we test the actual chromium algorithm vs the original proposed chroma reduction. These are plotted in linear light. Interpolation is done from `color(rec2020 1 0 1)` to `color(rec2020 0 0 1)` to `color(rec2020 0 1 1)`.

<img width="651" alt="Screenshot 2024-03-18 at 7 31 13 AM" src="https://github.com/w3c/csswg-drafts/assets/1055125/784e16f6-21fb-4d45-85ff-f5f972a1107c">

<img width="652" alt="Screenshot 2024-03-18 at 7 30 31 AM" src="https://github.com/w3c/csswg-drafts/assets/1055125/9d163b38-43d2-4195-a118-ca780905b979">

Now, perceptually, chroma reduction is probably more hue-accurate but doesn't quite give the colorfulness some may expect mainly because the smaller gamut can't produce higher chromas in that range. The chromium approach will allow for hue shifts in more notable ranges, but provide more colorfulness which can actually be less jarring to the eye when processing images.

Currently, the chromium implementation does not preserve colorfulness in more HDR ranges, like the "brilliant magenta" example, though I think it has been proposed to try and allow that. That would cause a greater difference in lightness if this was implemented, but in its current state, the lightness deviation is at least more subtle.

The question is: are we trying to solve gamut mapping pictures, smooth gradients with consistent lightness for contrast, or all of the above?

There are likely other approaches that maybe find some middle ground, but really, we need to define exactly what problem or problems are trying to be solved. If there is no agreement on what is being solved, the solution will not become evident.



-- 
GitHub Notification of comment by facelessuser
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9449#issuecomment-2004007339 using your GitHub account


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

Received on Monday, 18 March 2024 14:02:57 UTC