Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because a color space is a definition of the physical characteristics of the R, G, and B channels, usually given as points in XYZ space, along with the white point of the color space. Every color space is defined in terms of linear intensity from 0 to 1 for each of the color channels. Technically you can even have a color space with more than 3 channels, like what Weta are doing in their spectral renderer.

The point is that a "color space" is the definition of the physical characteristics of the individual channels. This is always linear. After that, many color spaces do define a transfer function for storing and transmitting the data, usually meant to be used for cases where not much precision is available, e.g. when you only have 8 bits per channel. So to say that you have to "switch to a linear color space" is incorrect, as you are not changing the color space, you are just transferring (applying the inverse transfer function) the values from their non-linear representation to linear.



I think you're nitpicking. The term "colourspace" is used to refer to the actual colourspace plus the nonlinear transfer function. The sRGB spec defines that transfer function.

You can nitpick and say that the "sRGB colourspace" is linear but it's still true that sRGB is nonlinear.


What do you mean by “physical characteristics”? sRGB is not a physical color space, which is part of why it’s non-linear. You seem to be confused about what people mean when they say “nonlinear color space”, and what makes a value linear.

A value is only “linear” with respect to something else. Not all values are linear. In the case of color, the words ‘linear’ and ‘non-linear’ are used with respect to physical measurements of light intensity such as watts per steradian or radiance.

sRGB values are not linear, because those values are not a linear transform away from physical measurements, it takes a non-linear function to map from physical measurement into sRGB.

The reason sRGB is non-linear is because when you add or multiply two sRGB colors to simulate physics like emission or reflection, you get the wrong color compared to what happens in the real world. To get the right color, you must transfer your sRGB inputs to linear space, combine them there, and then transfer the result back to sRGB space.

> many color spaces do define a transfer function for storing and transmitting the data, usually meant to be used for cases where not much precision is available

This is mostly wrong. The transfer functions define the color space, and they’re almost always defined for the purpose of emulating either display devices with non-linear response or human perception (which has non-linear response). sRGB’s non-linearity is emulating the non-linear gamma of your monitor https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gam...

Data space savings is almost entirely a byproduct of more closely matching human perception, and data savings is more or less only relevant to 8-bit color data or less (because 8 bits is not enough to represent linear color without getting visible color banding, but is almost enough when using a non-linear color space like sRGB, while 9 or 10 bits actually is enough to keep things in linear without banding). You still have to switch to linear color spaces to blend colors, even when using 16 or 32 bits per channel, so the compression side-benefits have very little to do with whether you need to use your transfer functions to switch between color spaces.

> So to say that you have to “switch to a linear color space” is incorrect, as you are not changing the color space, you are just transferring (applying the inverse transfer function) the values from their non-linear representation to linear.

This is entirely wrong. Using a transfer function or inverse is always a change from one color space to another, by definition. That’s exactly what a transfer function does, and it’s the only thing a transfer function does: changes (transfers) values from one color space to another. There is no such thing as a ‘linear representation’ of sRGB, there is only sRGB space and linear space. You aren’t making sense with the “non-linear representation” part, you just said all color space values are linear (even though that’s not true).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: