The Gamma correction

E-mail


The theory



Each monitor able to display images returns different values of luminance (usually identified with the generic term of "brightness") and each individual model provides a different response. However, we could identify a generic common behavior by splitting monitors into groups.
In the case of the CRT (cathode-ray tube) monitors we are able to observe how a variation of the input voltage corresponds to a change in luminance perceived on the screen. This relation between luminance expressed in volts and the screen returned and perceived luminance [cd/m²] is not linear , but exponential. This means that each time we double the input we won't get the doubling of the output, as we could normally expect.
The consequences of this behavior is a non-linear screen representation of intermediate shades between black and white.


If we represent the intermediate tones on a monochromatic scale placing the pure black on the left, at the origin of an x-axis and the white at x=1 value, we will notice that the medium medium gray (or 50% gray ) is shifted by +0.22 (to the right with respect to x=0.5) and positioned approximately at x=0.72.
greyscale 72


this is related to the fact that input and output ratio is:   formula gamma correction
where C is a characteristic constant of the specific monitor and its value is ~ 2.2.
In order to compensate this situation and achieve on the screen a linear progression like this:

corrected grayscale

We should have a gamma equal to 1, where the exponent becomes irrelevant and the progression changes from exponential to linear. To obtain this result it is necessary to compensate and correct the above mentioned typical CRT monitor gamma ( 2.2 ) with an inverse gamma, 1/2.2 ~ 0.45. That way we are compensating deviation of the ideal straight line with a mirrored and opposite curve.
To better understand, let's transfer the scale of monochromatic gray values (output) on a y-axis, while maintaining on the x-axis in the scale of input values. We can thus trace the curves obtained through the input luminance and perceived luminance ratio:



luminance curves diagram


As you could notice, in a common CRT monitor, an input value of 0.5 responds with a value of 2.18, performing a "gamma compression" due to the typical value of the exponent, equal to 2.2. The correction, as seen above, is achieved by forcing a "gamma expansion" assigning to the exponent a value equal to 1/2.2 ~ 0.45.

Actually the technology behind LCD panel (liquid crystals display) is totally different from CRT. The curves cannot be drawn as simple exponential curves, they trace a much more complex and discontinuous pattern. However, the manufacturers try as much as possible to simulate a response similar to the CRT. It's no surprise, then, that their fine setting is much more problematic. Generally their default response tends to underexpose the medium-dark tones, making difficult to read details in darker images. To override this problem many panels come out of the factory with an excessive set default luminance, that produces a loss of contrast in midtones range and a loss of distinction of lighter tones.

The practical solution


Once understood the problem and its theoretical solution, we can rely on common software tools for appropriate correction.
Some programs perform a correction, others just not. For instance, browsers typically do not implement any correction. Therefore becomes important to act upstream, with a specific software that fixes for all those "non-corrected" situations.
Correction tools can be generally found in the control panel of your graphics card. Several manufacturers provide a software in the settings section of the operating system. A graph similar to that above described helps you set curves across different gamma values. Be careful as often the graph is represented with X and Y axes reversed.
You can adjust the curves in the three separate channels red-green-blue. This gives you the ability to correct dominant colors.

For a rough adjustment, you can use the chart shown below:

grayscale


Taking into account that gamma correction does affect only intermediate tones leaving untouched full white and black, you can now adjust the gamma until all the shades of gray are distinguishable from each other. Remember that we are adjusting mid-tone contrast without altering the contrast between white and pure black. (As long as we don't move end and start points of the curve).

Decrease the value of gamma just until difference between the area 1 and 2 is scarcely perceivable. This will expand (or encode) the gamma value of PC-standard 2.2 to its inverse value 1/2.2 ~ 0.45.
This is a broadly approximated monochromatic adjustment and should be carried out taking care to properly screen the display from any possible natural or artificial light leaks.

Beyond the gamma correction

To refine the calibration of the screen you can use specialized software: some graphics cards and monitors provide a semi-automatic wizard that can guide you step by step. If you use some product of Adobe can use Adobe gamma loader.

Here's a method to ensure you carried out a good calibration: compare the image on the screen you just calibrated with the same image on rear screen of the reflex that you used for that shot. Generally the reflex displays are already calibrated and hardly an average user is able to improve that. Take care to properly screen both displays from any possible natural or artificial light leaks while comparing. The real limit of this test lies in the quality of lcd, but actual reflex reached a satisfactory level.


However, if you want a print proof calibration the most reliable method is the use of specific instruments such as spectrophotometers to be applied on the surface of the screen during the time required for calibration.

logo Unframe