Re: [csswg-drafts] [css-color-4] CSS gamut mapping algorithm clarifications (#7653)

> This is my first pass at the algorithm:
> 
> There seem to be some visual glitches outside the sRGB gamut, so I can't exclude translation errors on my part either in the code above, or in the glue code for the demo page, but I hope it's a good starting point.

I encountered this as well, and found that the problem was that I wasn't starting Newton iteration from near enough to the surface to convert. This is particularly bad in the non-convex areas of the the image the various gamuts in `oklab` space.

The solution that I started towards was to first intersect with a polyhedral approximation of the gamut and then refine using Newton iteration.

(I also found that the polyhedral approximation is extremely close to the gamut and might be better).

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


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

Received on Thursday, 25 January 2024 13:20:21 UTC