Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!sics.se!fuug!news.funet.fi!hydra!klaava!cc.helsinki.fi!osmoviita From: osmoviita@cc.helsinki.fi Newsgroups: comp.graphics Subject: Re: Gamma correction (was: Radiosity Image Correction) Message-ID: <1991May30.011813.1@cc.helsinki.fi> Date: 29 May 91 23:18:13 GMT References: <1991May27.135349.5072@vax5.cit.cornell.edu> <14070@exodus.Eng.Sun.COM> Sender: news@klaava.Helsinki.FI (Uutis Ankka) Organization: University of Helsinki Lines: 59 In article <14070@exodus.Eng.Sun.COM>, srnelson@nelsun.Eng.Sun.COM (Scott R. Nelson) writes: > > Also, since gamma correction is attempting to correct for the nonlinearity > of the CRT electron guns, and since the three electron guns in a color CRT > are of the same design, the gamma values for the three channels should be > the same. At least the people who sell monitor calibrator systems say that gamma values are different for different values -- phosphors age differently and perhaps there is some other reasons. > If you are computing an image using radiosity, ray tracing, antialiased > lines or even gouraud shading, you need to use a gamma corrected color > lookup table to properly view your image. > > This has been posted before, but here is a C code fragment to print a > gamma correction ramp for an 8-bit lookup table: > > /* > * gamma.c > * > * Print a gamma correction table. > * > * cc -o gamma gamma.c -lm > */ > > #include > #define clut_gamma 2.222222 > > main() > { > int i; > > for (i = 0; i < 256; i++) { > if (i % 16 == 0) > printf("\n"); > printf("%d: %d\n", i, > (int) (255.0 * pow((double) i / 255.0, 1.0 / clut_gamma))); > } > } > It is not sufficient for every monitor to define gamma correction table by so simple function. And gamma values vary much between monitors and adjustments. So if you need accurate images you must adjust your monitor, measure its transfer function and calculate the correction table from your measurements. And remember to fix contrast and brightness controls unmovable and do all measuring and viewings in dark room :-) > --- > > Scott R. Nelson srnelson@eng.sun.com > Sun Microsystems > > "Proofread carefully to see if you any words out." Kari Osmoviita osmoviita@cc.helsinki.fi University of Helsinki