Monday, August 31, 2015

sRGB gamma

In my previous post I did some gamma conversions to sRGB and a comment asked if I used the real sRGB gamma.   I did not.   From wikipedia the full formula is:

 


The linear part is only near the beginning (I think to avoid the infinite slope at 0).   I usually just use gamma = 1/2.2 as an approximation, but I thought I better check how much error that introduces.   For the part far from zero, the error is very small:



Nearer zero it's worse but as long as your range isn't in there gamma 1/2.2 is good enough for most things

No comments: