1.1.1 Gamma Correction

What is the relationship between intensity and brightness? Let us scale brightness and intensity in such a way that 1.0 is assigned to the maximal value. For a monitor it is clear what is meant by maximal value; on the other hand there is a minimal intensity we denote $ I_0$. Note that $ I_0>0$, i.e. absolute black is not possible, since the phosphors in the CRT (Cathode Ray Tube) reflect light. The proportion $ 1/I_0$ is called the DYNAMICAL RANGE of the monitor and is for CRTs usually typically 50 and 200.

Since on the computer we can only code a finite number of levels inbetween $ I_0$ and 1, we have to decide for which intensity levels they should stand for. Linear spacing like

$\displaystyle I_0, I_0+\Delta , I_0+2\Delta ,\dots, I_0+n\Delta =1.0
$

for some increment $ \Delta >0$ is not a good idea, since the eye is sensitive to ratios of intensity levels rather than absolute values of intensity. Thus we should space intensity levels logarithmically, i.e.

$\displaystyle I_0, r\, I_0, r^2\,I_0,\dots, r^n\,I_0=1.0
$

for some factor $ r>1$. For a dynamical range of say $ 100=1/I_0$ and $ n=256$ steps (as they can be coded by one byte in the range 0...FF) we obtain the factor $ r=\root{n}\of{1/I_0}\thickapprox 1.01815$ corresponding to a $ 1.8\%$ intensity increase for each step. The approximate intensity increase the human eye can detect is about $ 1.0\%$, i.e. $ r=1.01$. So we need $ n\geq \log_r(1/I_0)\thickapprox 463$ many steps to display a continuous scale from $ I_0$ to $ 1.0$ on a display with a dynamical range of $ 1/I_0=100$. Consequently, coding gray values using one byte(=8 bits) per pixel is not enough to ensure a continuous gray scale. In practice for B&W printing slight blurring due to ink bleeding and random noise reduces the number of distinguishable intensities to approximately 64.


Display media Dynamic range Intensity levels
  $ 1/L_0$ $ n=\log_{1.01}(1/L_0)$
CRT 50-200 393-532
Photographic prints 100 463
Photographic slides 1000 694
Figure: 128 steps
Image /home/andreas/tex/Books/computer-graphics/img//grayscale-128.png
Figure: True color
Image /home/andreas/tex/Books/computer-graphics/img//grayscale.jpg
Figure: True color & 256 colors
Image /home/andreas/tex/Books/computer-graphics/img//teapot.png    \includegraphics[width=0.45\textwidth]{teapot-256}
Figure: 128 & 64 colors
\includegraphics[width=0.45\textwidth]{teapot-128}    \includegraphics[width=0.45\textwidth]{teapot-64}
Figure: 32 & 16 colors
\includegraphics[width=0.45\textwidth]{teapot-32}    \includegraphics[width=0.45\textwidth]{teapot-16}
Figure: 8 & 4 colors
\includegraphics[width=0.45\textwidth]{teapot-8}    \includegraphics[width=0.45\textwidth]{teapot-4}
How can these logarithmically spaced intensity levels be displayed? According to the formulas above the $ i$-th level should have intensity

$\displaystyle I_i = r^i\,I_0.$

The intensity $ I$ of a CRT is proportional to $ N^\gamma $, where $ N$ is the number of electrons and $ \gamma $ is some constant depending on the phosphors used in the CRT and is usually in the range $ 2.2\leq \gamma \leq 2.5$. Since the number of electrons emitted is approximately proportional to the applied control-grid voltage $ V$ we have

$\displaystyle I=K\,V^\gamma$    for some constant $\displaystyle K.
$

So suppose the intensity we want to display is $ I$. The corresponding index $ i$ has to be chosen such that $ I_i/I$ is as close to 1 as possible, i.e. $ i=\operatorname{round}(\log_r(I/I_0))$. The corresponding $ V$ is thus $ V_i=\root{\gamma }\of{I_i/K}$. If this conversion is not hardcoded into the display, the software has to take account on this. This is called GAMMA-CORRECTION. Without gamma-correction quantization errors (produced by approximating true intensity levels by discrete displayable ones) are more conspicuous near black than near white.

Andreas Kriegl 2003-07-23