[csswg-drafts] [css-color-4] Gamut Mapping with Oklch - Odd Results (#7071)

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

== [css-color-4] Gamut Mapping with Oklch - Odd Results ==
I'd like to preface this, stating, Oklab and Oklch work great as interpolation spaces, but I am questioning how well it works for gamut mapping (at least with the current algorithm). Now, I understand that Oklch does a much better job at preserving hue, but in practice, when gamut mapping spaces, it seems to give odd results (in very specific cases).

Consider these different interpolations. We are interpolating from `green` to `blue` in various spaces. All colors are gamut mapped to sRGB.

The first set of examples is gamut mapping the interpolated colors into sRGB with Oklch chroma reduction. Notice how poor the results are for the Lch interpolation. Also, notice the harsher transition in the Oklch interpolation example on the far right, it is more subtle (this is very minor, but we'll see the difference when compared to Lch gamut mapping).

<img width="1201" alt="Screen Shot 2022-02-18 at 1 35 56 PM" src="https://user-images.githubusercontent.com/1055125/154761439-81ffb527-c9f5-4802-b1f9-c554886f0557.png">

Here we are using Lch to gamut map. Everything gives nice, clean transitions and gamut mapping is visually more appealing.

<img width="1232" alt="Screen Shot 2022-02-18 at 1 36 07 PM" src="https://user-images.githubusercontent.com/1055125/154761673-167c3b4e-3de5-4977-b5d9-bce7bc5721dc.png">

Obviously, such cases are specific to very certain color cases, but this case doesn't seem too far-fetched of one.

Granted, the interpolations of Oklab and Oklch generally look nicer on both, but gamut mapping with Oklch chroma reduction vs Lch chroma reduction turns out very differently.

Maybe this is all generally expected and accepted, but I wanted to at least bring the topic up as it would be a very jarring case when interpolating simple colors like `green` and `blue` with Lch. Ignoring whether hue is preserved better or not through the gamut mapping process with one space vs the other. Visually, Lch seems to give better results for what I think people would expect.



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


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

Received on Friday, 18 February 2022 21:31:58 UTC