3 ms·
The transfer functions in your (rec.709) color space is non-linear indeed. However, the pixel values you store are in a linear relationship with each other. The
by jlouis 3y ago
The transfer functions in your (rec.709) color space is non-linear indeed. However, the pixel values you store are in a linear relationship with each other. The difference between values 20 and 21 are the same as the difference between values 120 and 121, assuming an 8bit signal. I.e., the information is the same for all pixels. Further down the chain, these values are then mapped onto a gamma curve, which is non-linear.
What the "log"-spaces are doing is to use a non-linear relationship for the pixel values, as a form of lossy compression. If the signal has to factor through 8bit values, using a compression scheme before it hits the (final) gamma curve is a smart move. If we retain less precision around the low and high pixel values and more precision in the middle, we can get more information from the camera sensor in a certain region. Furthermore, we can map a higher dynamic range. It often looks more pleasing to the eye, because we can tune the setup such that it delivers a lot of precision and detail where our perception works the best.
In short: we are storing (8bit/10bit) pixel values. The interpretation of these values are done in the context of a given color space. In classic (rec.709) color spaces, the storage is linear and then mapped onto a non-linear transfer function. In the "log" spaces, the storage is non-linear and is then mapped onto a non-linear transfer function. In essence we perform lossy compression when we store the pixel in the camera.
- thrdbndndn 3y agoThanks for the technical details. I think I get what you mean (in term of implementation), but can't we just alter the transfer function further so there are more values used for the mid-range colors? The two-step process you said (the storage is non-linear and is then mapped onto a non-linear) is basically equivalent to a singular transfer function which is the combination of two curves, since the sampling process itself is lossy.
- jlouis 3y agoYes, you can combine the steps to make it more efficient. In that view, it's "just" a different gamma curve. It's far harder to "split" a curve than combining two steps though.
- weebull 3y ago> The transfer functions in your (rec.709) color space is non-linear indeed. However, the pixel values you store are in a linear relationship with each other. The difference between values 20 and 21 are the same as the difference between values 120 and 121, assuming an 8bit signal. I.e., the information is the same for all pixels. Difference on what scale? ... because (hint hint) it's not number of photons that hit the sensor. Nor is it photons emitted from the display. The truth is, it's a linear measure of the voltage which drives the electron beam of a CRT. Not a very useful measure anymore, but we've encoded this response curve into all of our images and, now, this is proving to be a mistake. Working with images would be so much easier if we stored values that represent linear light (i.e. proportional to photons entering/leaving a device) with no device curves baked in. Log formats do this, but because the order of magnitude of light is more important than the absolute value, it takes the log of the value. It's a more efficient use of bits in the storage / transmission.
- thrdbndndn 3y agoGamma curve is needed due to the fact human eyes are more sensitive to darker areas than the brighter areas (Stevens' power law), so with gamma you can get away with lower bit width without (perceptually) introducing noticeable banding. The fact it somewhat matched with a response curve of CRT seems to be a historical coincidence, based on multiple sources I've read in these years. I do agree we should have get rid of it at this point as it introduces many errors in color blending. > Log formats do this, but because the order of magnitude of light is more important than the absolute value, it takes the log of the value. It's a more efficient use of bits in the storage / transmission. It literally is what gamma curve does, ina slight different but mathematically equivalent way. "Order of magnitude of light is more important than the absolute value" is exactly what Stevens' power law describes.
- kllrnohj 3y agoNo, gamma2.2/sRGB is how the pixels are stored on disk, not linear values. Linear is almost never used except as an intermediate for processing where you can throw lots of bits at it (eg, fp16/32 on a GPU when applying effects or whatever) The difference is how the curves prioritize what bits to keep. Rec709 sacrifices the bright end to keep more detail in the darks, whereas log is more like linear perceptual brightness. So it'll have less low light detail but more bright detail by comparison