Accurate Image Manipulation for Desktop Publishing  
Gamma Errors
 
 

What are Image-Gamma Induced Errors

When image enhancement operations such as sharpening or USM, blurring, saturation etc. are applied over gamma compensated images these operations affect both:

  1. to the image data itself
  2. to the gamma compensation.

The CRT gamma compensation is buried (calculated) into the image data, images appear very dark on uncalibrated CRT unless the image data is gamma compensated.

The performance of nearly all editing operations and filters are adversely affected when gamma compensated images are edited. This is because:

  1. the gamma compensation is changed by the editing operations and
  2. the tri-stimuli color spaces such as RGB or CMY(k) are linear by nature.

The gamma induced errors accumulate, each operation will add them, operation by operation. Some operation will boost up the noise, some affect to the edges (white-edging) some darkens the edges unnaturally, some create hue-shifts etc. Many filters produce completely unacceptable results like the FindEdges filter.

Please select demonstrations of the Gamma Induced Errors from the content list on the left and be surprised.

Be sure to see also the Gamma errors as the function of processing gamma space in addition to the magnitude of the gamma induced errors in different gamma spaces it shows the amazing capability of the eye to adapt to the gradually degrading quality.

Also Mr. Helmut Dersch, the author of the very powerful plug-ins for Photoshop called Panorama Tools demonstrates image-gamma induced errors (his Web site is temporarily closed) related to interpolation such as free-transform, rotation, scaling and resizing. He even provides the linearise, then apply operation then gamma-back-in -option in his software.

Note that the demonstration pages have three images on top of each other so they take some time to load. If the images are not completely loaded then nothing happen when you press an option button, so please be patient and wait until the page has completely loaded then the image switching happens in a blink since they come from the image cache of your browser. The demos truly are worth the short wait.

Note that at the same time you can evaluate the dreaded banding issue that is so often said to be the burden of linear space editing.

All demonstrations are compensated for gamma 2.2 viewing. Gamma space of uncalibrated PC systems is 2.5 and uncalibrated Mac systems are in gamma space 1.72. However with this evaluation I use the "standard" 2.2 in order to avoid gamma speculations.

The jpeg compression softens the difference, to see the real thing please download the originals and the gamma curves and evaluate yourself.

21th Sep 2001. When evaluating using Photoshop 6.0.x as the first step remove (unassign, Image/Mode/Assign... None) the embedded profile from the original. Photoshop 6.0.x behaves way differently (correctly) than the 5.x that was used when the original image was saved.

How to Avoid the Gamma Induced Errors

Gamma induced errors can be avoided only by editing linear image data.

It is possible to write an image editing software that manages the file-gamma properly, such software would calculate the gamma compensation away, then apply the operation and finally calculate the gamma compensation back in. This for nearly every operation.

Obviously such a software would be very slow due to the extra calculation and it would introduce a lot of round-off errors. Therefore there are no such software available, instead better image editing applications provide the possibility to calibrate the viewing gamma to unity (gamma = 1.0) either within the image editing application (usually RGB setup or Monitor calibration -dialog) or even system wide (by an utility like AdobeGamma).

Related Photoshop specific Issue, Middle Input Box in the Levels dialog is highly inaccurate.

 

Use the option buttons to evaluate

No compensation applied (original linear)

CRT gamma compensation for gamma space 2.2 viewing applied using:
PaintShop Pro v 4.0. OK
Corel Photo-Paint 8.0. OK
Mgx Picture Publisher 8.0. OK
Photoshop, accurate map loaded to Curves. OK
Photoshop, Levels dialog, in 8-bit/c. BIG ERROR
Photoshop, Levels dialog, in 16-bit/c. HUGE ERROR

If you re-create the experiments by yourself (highly recommended) using Photoshop then you must use the inverse gamma 2.2.amp file from this zip-archive in Curves dialog in order to accurately apply the gamma function.

The middle input box in the Levels dialog of Photoshop is not an accurate gamma function it has a feature called "slope limiting" that is a deliberately embedded bug, it seriously damages the shadows if it is used for gamma compensation.

The demonstration on the left shows the damage when the the middle input box in the Levels dialog is used to apply a gamma compensation.

Linear graph that contains all the 255 gray levels is compensated for viewing in gamma space 2.2 using several image edition applications and with the accurate inverse gamma 2.2.amp.

In Sep, 2001 a forum member at AdobeForums notified that the middle input box in the Levels dialog is even more damaging when the image is in 16-bit/color mode. This is incomprehensively huge error, please evaluate above. A graphical view to the errors.

All the other software provide the correct, accurate gamma compensation so one can not discern any difference between them only the Middle Input Box in the Levels dialog of Photoshop has error.


Accurate Image Manipulation for Desktop Publishing 
Copyright Timo Autiokari, 1998-2004. Contact info