I have few questions regarding tone-mapping and gamma correction.
is a tone-mapping operator a function whose output is a value between [0,1] ? If this isn't the case and since gamma encoding requires a value to be in range [0,1], do I need to normalize the values after tone-mapping?
imagine a diffuse horizontal surface with (0.5,0.5,0.5) reflectance under an unobstructed uniform sky of radiance (1,1,1) cd/m2. The incident radiance on an image pixel coming off this surface will have value of (0.5,0.5,0.5). Now, most codes I have seen apply gamma encoding(raising pxl value to the power of 0.45) at this stage just before saving it to the file. But on viewing the image, the colors are distorted and much brighter corresponding to (186,186,186) color value. If I don't apply gamma encoding then the image file displays the expected color that is (127,127,127).
If the CRT monitor or the LCD does apply the inverse of gamma, then by encoding it I must see the original color that is (127,127,127), is that right? And if I am seeing (186,186,186) instead, am I right therefore to assume the encoding happens internally on saving the image data as png or jpg format? and therefore I don't need to do any gamma encoding?