What is gamma correction?
What is the gamma of my display system?
Adjusting the gamma for your display system
Custom palettes may be created or modified by specifying individual index colors and optionally blending ranges.
Creating a RGB Palette:
In the field of Computer Graphics, one often hears the phrase "gamma correction." What is this strange sounding thing and why does it matter to you?
Gamma correction matters if you have any interest in displaying an image accurately on a computer screen. Gamma correction controls the overall brightness of an image. Images which are not properly corrected can look either bleached out, or too dark. Trying to reproduce colors accurately also requires some knowledge of gamma. Varying the amount of gamma correction changes not only the brightness, but also the ratios of red to green to blue.
To explain gamma correction we will begin with where you are looking - your computer monitor.
Almost every computer monitor, from whatever manufacturer, has one thing in common. They all have a intensity to voltage response curve which is roughly a 2.5 power function. Don't be afraid, this just means that if you send your computer monitor a message that a certain pixel should have intensity equal to x, it will actually display a pixel which has intensity equal to x ^ 2.5 Because the range of voltages sent to the monitor is between 0 and 1, this means that the intensity value displayed will be less than what you wanted it to be. (0.5 ^ 2.5 = 0.177 for example) Monitors, then, are said to have a gamma of 2.5
To correct this annoying little problem, the input signal to the monitor (the voltage) must be "gamma corrected".Sample Input to Monitor Graph of Input Output from Monitor Graph of Output L = V ^ 2.5Note: The grayscale images will not look very good on 8-bit color computers. Also the gamma correction for these images is 1.0 so they were actually designed to be viewed on a system such as a Sun or a PC with no hardware correction. They may appear brighter on other systems. The important thing here is the relative difference that you see.
The solution, fortunately, is a simple one. Since we know the relationship between the voltage sent to the monitor and the intensity which it produces, we can correct the signal before it gets to the monitor. The signal is adjusted so that it is essentially the complement of the curve shown above. There are other considerations as well when one speaks of a "correct" image. These include the ambient light in a room where the computer is, the brightness and contrast settings on the monitor, and finally personal taste.
If gamma correction is done properly for the computer system, then the output should accurately reflect the image input.Sample Input Graph of Input Gamma Corrected Input Graph of Correction L' = L ^ (1/2.5) Monitor Output Graph of Output
Note that the task of gamma correction is accomplished by raising the input value to the 1/2.5 power. This is referred to as a gamma correction of 2.5. because we are correcting the input for a monitor whose gamma is 2.5
As we mentioned above, most monitors work in about the same way with respect to gamma correction. Most computers, or more specifically, most computer systems, do not work in exactly the same way, however.
Macintoshes, for example, have partial gamma correction built-in to their hardware. Silicon Graphics computers also have built-in gamma correction, but it is different from the Macintosh. Suns and PCs have no standard built-in gamma correction but some graphics cards installed in these computers may provide this functionality.
The image below allows you to directly estimate the gamma of your display
system. Stand about 6 feet or more away (until the dots are not perceptible)
and decide which column of the image comes closest to having equal brightness
in the top and bottom halves. The number under this column is the gamma
of your display system.
The image below contains 2 rows of 3 squares, with the value of the
squares in each row varying from 25% to 75%. The top row uses gray values;
the bottom row simulates the grays by dithering. On a display which corrects
for monitor gamma the top squares will have the same apparent brightness
as the corresponding bottom squares. On a system which does not correct
for monitor gamma the top row of squares will appear darker than the bottom
row. Standing about 6 feet or more away (until the dots are not perceptible)
from the monitor gives the best results.