Skip to content

How to confine manipulated colors to sRGB space #416

Answered by facelessuser
cfra asked this question in Q&A
Discussion options

You must be logged in to vote

Yep, we have a whole section covering how to "fit" or gamut map a color here.

In short, you can gamut map a color at any time by calling .fit() or .clip().

The only place gamut mapping happens automatically is when you serialize the color to a string via .to_string() and the color is bound to a specific gamut, but that can be disabled via .to_string(fit=False).

In addition, we do provide the convenience .convert() return a color within gamut mapped by enabling it via .convert(space, fit=True), or by passing in the gamut mapping approach via a string or a dictionary object that sets the gamut mapping options. This only works if the color space you are converting to is bound to a gamut.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by facelessuser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
S: triage Issue needs triage.
2 participants
Converted from issue

This discussion was converted from issue #415 on April 08, 2024 11:54.