The full correct formula is:
https://stackoverflow.com/a/13558570
Interestingly gamma correction also includes a linear component. For more info on why:
https://poynton.ca/notes/colour_and_gamma/GammaFAQ.html#gamm...
The full correct formula is:
https://stackoverflow.com/a/13558570
Interestingly gamma correction also includes a linear component. For more info on why:
https://poynton.ca/notes/colour_and_gamma/GammaFAQ.html#gamm...
One possible theory why there's a linear term is so that negative values are well-defined. In consumer HDMI, reference black is 10 (as opposed to 0 in sRGB), and reference white is 235 (as opposed to 255 in sRGB).
Since there no doubt be experts here, I'd love to see an authoritative answer. (I'm considering writing an explanation of sRGB and if so would really like to get this right)
It took a lot of Googling, but I finally found an article that explains why, in case anyone else is interested:
"The 601 system allows colors that are darker than black and brighter than white. This is especially important for cameras, because you may occasionally shoot an object that has a bright spot that is “hotter” than legal white, and might want a way to later recover the detail in this hot spot. Going darker than broadcast black is also used at times for synchronization signals, as well as some primitive keying applications such as “superblack” where systems mask or key out areas of an image “blacker” than black."
Lots of consumer electronics is designed with these kind of rules.
> The effect of the above equations is to closely fit a straightforward gamma 2.2 curve with an slight offset to allow for invertability in integer math. Therefore, we are maintaining consistency with the gamma 2.2 legacy images and the video industry as described previously.
And to this I'll add another speculative answer, similar to others that have been advanced, but I'm not sure it's ever been explicitly expressed: it means that a piecewise linear approximation in either direction can be done with good accuracy and not a huge number of segments.
Of course, if you want, you can figure out the equivalent “chain rule” of your operation, but realistically sRGB also mostly exists to compress colors into 8-bits per channel which doesn’t allow for great manipulation. Fun fact: this is why LRBni had a “load 8-bit as sRGB and upconvert to linear floating point”.