- From: Isaac Muse via GitHub <sysbot+gh@w3.org>
- Date: Tue, 27 Feb 2024 14:58:41 +0000
- To: public-css-archive@w3.org
I've added a GMA algorithm that can be experimented with here: https://colorjs.io/apps/gamut-mapping/?color=red&color=oklch%2890%25+0.258+29.2%29&color=oklch%2890%25+0.06+29.2%29. ([source](https://github.com/color-js/color.js/blob/main/apps/gamut-mapping/methods.js#L53)). It is a chroma-reduction approach. It basically uses the simplicity of the RGB shape and uses ray casting, whichis easy to perform on simple, aligned cube, to find the most saturated point on the cube for a given color. This point is corrected in the perceptually uniform OkLCh space. It takes 3 attempts and is able to reduce chroma while keeping lightness and hue lower than the CSS algorithm. Tests showed worst cases (gamut mapping to display-p3) are approximately: ∆L ~= 0.011682128741787201 ∆h ~= -4.212684767726387. It is much faster than the CSS approach which had a maximum deviation of approx. ∆L ~= 0.01935711395956019 ∆h ~= 67.51890805748971. In its defense, this worst case is at extremely low light `oklch(0.015 0.8 96.5)`. For a generic approach that doesn't have to approximate the shape of Oklab, I'm kind of surprised how well it turned out. -- GitHub Notification of comment by facelessuser Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9966#issuecomment-1966741383 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 27 February 2024 14:58:42 UTC