The formulas for converting sRGB colors to linear, and the reverse, are usually given as follows:
The definition uses two different functions – a straight line and an exponential curve – glued together at a certain “cutoff point”. The implication is that these functions (the ones in the sRGB to Linear definition) intersect at the point:
If we take a close look at the function, though, we can see this intersection point is not exact, so the formula has a slight discontinuity:
If we extend the functions, we see that they actually intersect at two points:
The intersection points are approximately:
If we use either of these two points as the cutoff point, there will be no discontinuity at all. It’s apparent that the sRGB inventors selected the second of these points, and rounded its value to 4 significant digits to get 0.04045. They then used that rounded sRGB value to recalculate the Linear value, and got 0.00313080. I don’t know why their Linear value has more significant digits (5 or 6) than their sRGB value (4).
I guess that if you’re a perfectionist, and want no discontinuity at all, you can tweak the formulas like this:
It doesn’t make any practical difference. The two functions are extremely close together in this region, so the precise cutoff point is almost irrelevant.
Some references give a formula with a different cutoff point:
|sRGB to Linear|
|0 ≤ S ≤ 0.03928||S/12.92|
|0.03928 < S ≤ 1||((S+0.055)/1.055)2.4|
Evidently, this came from the fact that the slope of 1/12.92 is actually a rounded version of a more theoretically correct slope of about 1/12.92321. A cutoff of 0.03928 is what you would arrive at if you used that slope.
However, the sRGB standard defines 12.92 as the exact value to use. So I don’t think it would be correct to use 12.92321 in sRGB formulas.
In any case, there’s certainly no reason to use 0.03928 together with 12.92. That would be half-baked, and it leads to a discontinuity that is possibly big enough to be significant: