Skip to content

[css-color-4] Is CSS Gamut Mapping intended to apply to CSS gradients? #14051

Closed

Description

@weinig

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

  1. svgeesus commented on Jul 16, 2026

    @svgeesus
    Collaborator

    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.

  2. self-assigned this
    on Aug 31, 2026
  3. svgeesus commented on Sep 1, 2026

    @svgeesus
    Collaborator
  4. added
    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.css-color-4Current Work

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions