Sunday, July 29, 2007
Gamma and textures.
Gamma correction issues are always a pain. A review: given 256 grey levels, it makes sense to make them perceptually uniform. Thus a 20% grey intensity (one fifth the physical intensity of white) should be around 127 as it is perceptually half way between black and white. But what happens when you want to use it as a texture map in a physically based renderer? You need to "de-gamma" the image. If you are using somebody else's renderer, should you do that as a preprocess or might they do it? For my own purposes in that situation I have made three textures of the grey squares in the macbeth color checker chart. The grey square in position 3 from the left (i.e., the third darkest) should look mid-grey in your final render. The 1.0 image has 0.19*255 in that square so it is not gamma corrected (i.e. the byte values are linear in intensity). Of course to make this all more complicated, a renderer might or might not do something different if there is something in the texture's color profile or not.