JohnConover_medium.jpg 
john@email.johncon.com
http://www.johncon.com/john/

Linux System Gamma Calibration


Home | John | Connie | Publications | Software | Correspondence | NtropiX | NdustriX | NformatiX | NdeX | Thanks



home.jpg
john.jpg
connie.jpg
publications.jpg
software.jpg
correspondence.jpg
ntropix.jpg
ndustrix.jpg
nformatix.jpg
ndex.jpg
thanks.jpg

Electronic display devices-things like computer terminals, television sets, printers, and cameras-do not respond to, (or produce,) light intensity linearly; they are designed intentionally that way. The dominate standard for how display devices produce light intensity is the NTSC specification which requires a gamma of 2.2 to be used in US television receivers. A gamma of 2.2 means that if the transmitted signal increases by a factor of two, the corresponding light intensity on the television CRT increases by 2^2.2, which is a factor of about 4.6. A gamma of 2.2 has also been adopted by the World Wide Web Consortium as a standard, sRGB, for Internet browsers. Note: there is an addendum, ViewSonic VA503b Gamma Calibration, that uses the techniques outlined here for LCD computer monitors.

Unfortunately, not all manufactures subscribe to the standards. For example, a gamma of 1.8 is often used in printers, (since that was the gamma used in the original Apple Macintosh/LaserJet combination,) and other companies, like Silicon Graphics, have their own gamma standard, (a gamma of 1.6 is used in Silicon Graphics' terminals.) Additionally, the European standard for television receivers is a gamma of 2.9, and many monitors use this value to increase depth of color. Note that as long as gamma is consistent for all display devices, (for example, Apple uses a gamma of 1.8 on their display, and on the LaserJet printer, both,) all will exhibit the same response to light intensity.

But there are compounding issues-most electronic printers have programmable gamma settings, (so one could, in principle, do artwork on a Silicon Graphics machine, and print it on an Apple/LaserJet printer, for example.) However, printer paper alters the printer's gamma; not to mention that most digital cameras have programmable gamma settings, too, as do almost all electronic display devices.

I will demonstrate a calibration proceedure for system gamma, (system gamma means that all devices-printer, terminal, camera, etc.,) have the same gamma. The proceedure will calibrate the monitor first, and then use that as the standard for calibrating other devices.

Monitor Gamma Calibration

First point your browser at Norman Koren's excellent gamma page, and about half way down the page is a gamma chart. Make sure the room in which you are working has minimal light, and it comes from behind the screen to avoid reflections. Turn the intensity on your monitor to maximum, and set the degrees Kelvin to 6500K. Adjust the brightness on the monitor until you can just see the left hand vertical bar at the bottom, (the one labeled "A",) and the right hand bar, (the one labeled "B",) should be visible from the bottom to about half way up the chart. Absolute black on your monitor is now calibrated.

Now adjust the gamma of your monitor such that the shade of gray completely across the "Gamma" column is the same at 2.2. You can use Adobe Photo Shop to adjust the gamma, or xgamma under X Windows on Unix/Linux systems.

As an example, on my monitor, an NEC AccuSync 70, running Linux, I have to use "xgamma -gamma 1.3" for correct gamma calibration.

The monitor is now calibrated, and will be used as a refererence standard for other devices-a digital camera and a printer will serve as examples. For these, you will need another gamma chart, gamma.png.Z, or you can use my copy:


gamma.png

and save it.

Digital Camera Gamma Calibration

I will use a FujiFilm FinePIX A205 for demonstration purposes. Darken the room, and take a picture-without flash-of the file gamma.png displayed on the calibrated monitor, (you can use your browser to display the file, Adobe PhotoShop, or ImageMagick's display command under Unix, etc. This will require a steady hand, but does not need to be a work of art. Download the picture out of the camera into the computer, and display it on the calibrated monitor. The shade of gray made by the black and white thin stripes should be the same as the background gray behind the number 2.2 at only 2.2, (for numbers less than 2.2, the gray made by the stripes will be too light, and for numbers greater than 2.2, the gray made by the strips will be too dark.) The picture I made to calibrate the A205:


dscf0909.jpg

used The Gimp to display the gamma.png file since it can be used to adjust gamma if I had to. If the camera does not produce a gamma of 2.2, then check the camera's documentation, and/or, use a program like The Gimp to pre-process files out of the camera before manipulation or printing. I usually print out of The Gimp, too, since some gamma correction will be required for printing a digital picture, depending on the type of printer paper, (yes, the type of printer paper does, indeed, change the gamma of the printer.)

Printer Gamma Calibration

The same technique used in calibrating the camera will be used to calibrate the printer. Make sure your print software will print ".png" files to your printer, (CUPS certainly does,) and print the gamma.png file. Many printers allow their gamma to be programmed, (1.6, 1.8, 2.0, and 2.2, are common values,) but if it doesn't, you can still adjust gamma for the printer in the print program, (like The Gimp.) If the printed output has a gamma of 2.2, then take a picture of it using flash, but make sure there is no light directly incipient on the paper, (the light will change the gamma unless you have a special light that produces a 5600K temperature.) I use an Epson Stylus Photo 780, and its calibration picture:


dscf0931.jpg


was made with the A205. Display the downloaded picture on the calibrated monitor. Note that this is a complete system check: printed output to camera to display. They should all have a gamma of 2.2.

For the 780 I have to adjust gamma to accomodate different printing paper types. I personally use The Gimp for that. Here are the equations I use to calibrate the printer for different paper reflectivities.

Let I be the input light intensity, (say on the CCD of a camera,) that has an output file gamma, Gf, a printer gamma, Gp, and a correction gamma, Gc, (altered in the print program, The Gimp,) and an output light intensity, O, from printer. Then:



            ((I^(1 / Gf)^Gc)^Gp = O

        

and taking the log of both sides:



            Gp ln ((I^1 / Gf)^Gc) = ln (O)

        

and reducing:



            Gc Gp ln (I^(1 / Gf)) = ln (O)

        

or:



            ((Gc Gp) / Gf) ln (I^(1 / Gf)) = ln (O)

        

and if:



            I = O

        

then:



            Gc Gp = Gf = 2.2

        

On the Epson 780 Photo Stylus printer, printing on photo copier stock, the gamma correction, Gc, required in The Gimp for a printed output gamma of 2.2 was 0.818; for Epson Professional Glossy Paper S041286, (68 lb, 10.4 mil, 97% Opacity, 92 ISO Brightness,) the required gamma correction was 0.636; and for Epson Glossy Paper S041141, (52 lb, 9.4 mil, 96% Opacity, 99 I SO Brightness,) the required gamma correction was 0.683.

However, The Gimp print routines have a paper/media selection, which further complicates the issue. The "Epson Professional Glossy Paper" S041286 and a Gimp Media Type: Epson Professional Glossy Paper requires a Gimp print gamma of a little more than 0.818 for the final print to have a gamma of 2.2 on the Epson Stylus Photo 780; for Epson "Glossy Photo Paper" S041141 and a Gimp Media Type: Photo Paper, the Gimp print gamma was also about 0.818 for a final print gamma of 2.2; likewise for inexpensive photocopier paper, and a Gimp Media Type: Plain Paper, the required Gimp print gamma was 0.818 for a print gamma of 2.2. (Note: the default printer gamma for the Epson Stylus Photo 780 is 1.8; the Gimp printer gamma of 0.818 alters the overall print gamma to 1.8 / 0.818 = 2.2; there is a configuration option on the 780 for a printer gamma of 2.2, in which case the three types of paper would require no print system gamma correction, whatsoever, for correct system gamma compatibility with the NEC AccuSync 70 and FujiFilm FinePIX A205-the media/paper selection in the Gimp would suffice for correct system gamma.)

It is actually fairly easy to keep everything in calibration, if the last thing you do before downloading a lot of files out of the camera is to shoot a screen shot of the file gamma.png you have documented what gamma everything is running, and can keep it as part of the photo archive.


License

A license is hereby granted to reproduce this software for personal, non-commercial use.

THIS PROGRAM IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO WARRANTIES WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE. THE AUTHOR DOES NOT WARRANT THAT USE OF THIS PROGRAM DOES NOT INFRINGE THE INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY COUNTRY.

So there.

Copyright © 1992-2009, John Conover, All Rights Reserved.

Comments and/or problem reports should be addressed to:

john@email.johncon.com

http://www.johncon.com/john/
http://www.johncon.com/ntropix/
http://www.johncon.com/ndustrix/
http://www.johncon.com/nformatix/
http://www.johncon.com/ndex/



Home | John | Connie | Publications | Software | Correspondence | NtropiX | NdustriX | NformatiX | NdeX | Thanks


Copyright © 1992-2009 John Conover, john@email.johncon.com. All Rights Reserved.
Last modified: Tue Mar 10 01:55:15 PDT 2009 $Id: index.html,v 1.0 2009/03/10 08:55:25 conover Exp $
Valid HTML 4.0!