[css-color-4] Is CSS Gamut Mapping intended to apply to CSS gradients? #14051
Description
In § 14.2. CSS Gamut Mapping to an RGB Destination, there is a not that states:
these algorithms are for individual, distinct colors; for color images, where relationships between neighboring pixels are important and the aim is to preserve detail and texture, a perceptual rendering intent is more appropriate and in that case, colors inside the destination gamut could be changed.
That seems to imply it is really only for pure color usage, but I wanted to clarify first that did or did not include things like CSS Gradients, where a pure color is used as input, but ultimately, the output is an image.
I ask mainly because in some of the gamut mapping discussions, gradients have been used tangentially, e.g. here, for a performance test - #10579 (comment).
cc @svgeesus
Activity
svgeesus commentedon Jul 16, 2026
The key difference here between what ICC calls Rendering Intents is that Relative Colorimetric (all the CSS gamut mapping algorithms have that Rendering Intent) leaves in-gamut colors unchanged while Perceptual (which is commonly used with photographic images) can and often does move in-gamut colors as well, to preserve overall appearance. Which means colors in a photo might not match colors used in CSS even for the same rgb values and colorspace.
I agree though that "individual, distinct colors" sounds like it doesn't apply to gradients; that was not the intention.
[css-color-4] Clarify that relative colorimetric is good for gradient…
[css-color-4][editorial] remove trailing mention of "individual" whic…
svgeesus commentedon Sep 1, 2026
@weinig please see clarification in 14.2. CSS Gamut Mapping to an RGB Destination