Skip to content

Negative sRGB values from "colour.XYZ_to_sRGB" definition. #699

Answered by KelSolaar
lenzls asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Lensz,

Negative values are not unexpected and bad, they are actually very desirable!

Let me explain: a given RGB colourspace gamut may or may not be able to encode the entire visible spectrum, as a matter of fact, only a few do such as ACES 2065-1.

When you work with 8bit or 16bit integers, what usually happens is that any colour that cannot be encoded is clipped to stay within the bounds of the RGB colourspace gamut. This effectively destroys colour information, meaning that if you wanted to go back from sRGB colourspace to CIE XYZ colourspace in your case, you wouldn't retrieve the original tristimulus values.

Colour operates with 32bit floating point numbers, which yield negative v…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by KelSolaar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #257 on January 16, 2021 22:31.