Skip to content

[css-color-4] Incorrect step in gamut mapping algorithm #9618

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

Closed
facelessuser opened this issue Nov 20, 2023 · 1 comment
Closed

[css-color-4] Incorrect step in gamut mapping algorithm #9618

facelessuser opened this issue Nov 20, 2023 · 1 comment

Comments

@facelessuser
Copy link

I believe step 15 of the GM algorithm is incorrect.

return current as the gamut mapped color

It should be

return clipped as the gamut mapped color

The reason why this is incorrect is that the algorithm is reducing chroma until it is reasonably close to a clipped version of itself, such that there should be no noticeable difference. The chroma-reduced color is not guaranteed to be within gamut, but the clipped version is, though the visual difference should be negligable. This was originally the intent in the revised proposal #7135 (comment).

@svgeesus
Copy link
Contributor

I agree, this is an error that crept in, it was always supposed to be the clipped value that was returned. The result as currently specified is similar, but has extra pointless work when we already have a result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants