#GAMMA Formula in 3DS
30-May-95 12:35:20
Sb: #171782-#GAMMA Formula in 3DS
Fm: Jonas Ruikis [ADESK] 73172,1351
To: John Ellis 72440,3046
Hi John,
<< the formula.. >>
There is nothing special about 3DS's use of gamma. The forumla is simply:
(1.0 / gamma)
(x / 255.0) * 255
where x is a value between 0 and 255 and the result is a number between 0 and
255 (if you are dealing with 8 bit deep intensities). Here is a simple
verification of this. With 3DS's default gamma value of 1.8 go into 3DS and
set the background so that green is set to 128 and then render to your favorite
24 bit image file format. Then with your favorite image file tool you will
find that all of the pixels have a green component of 174 (or one different if
dither is on). This corresponds to:
(1.0 / 1.8)
(128 / 255) * 255 = approximately 174