In this article about sRGB (https://en.wikipedia.org/wiki/SRGB) is stated, that the gamma transformation has a linear portion near zero, to "avoid having an infinite slope at K = 0, which can cause numerical problems". I'd like to know what's the problem with that.
There are two answers, as is usual for gamma. The modern variant is:
The problem is that with an infinite slope you need "infinite" resolution (many bits of storage) in order to arrive at a linear representation that is invertible to gamma-encoded without loss. In other words, it allows for a small lookup table to produce an invertible linear encoding (8bit -> 10 bit -> 8 bit).
The numerical problem is most easily understood on the first step (8 bit -> 10 bit). With an infinite slope near zero, you need a much bigger encoding range to stay faithful and reversible, i.e. you'd need more than 16 bit (assuming integer coding, halfs do not have this problem).
The linear equivalent of #010101 or 1/255th with square (gamma = 2.0) coding is 1/(255*255)th. You would need 16 bits to represent that faithfully, and using 2.2 not 2.0 as an exponent would make it worse. These quite small numbers are just a corollary of the coding function, and in practice you don't need much resolution in a lightness range that is, roughly, black. So the linear segment helps coding by not wasting resolution to detail around black (or near zero).
The slightly older answer, taken from
http://www.poynton.com/notes/colour_and_gamma/GammaFAQ.html#gamma_correction
is that in some equipment this linear segment will be less sensitive to noise. This is probably mostly true of the analog signal path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With