i
i
i
i
i
i
i
i
3.2. Images, Pixels, and Geometry 63
gives an intensity halfway between black and white. This a will be
0.5=a
γ
.
If we can find that a, we can deduce γ by taking logarithms on both sides:
γ =
ln 0.5
ln a
.
Figure 3.11. Alternat-
ing black and white pixels
viewed from a distance are
halfway between black and
white. The gamma of a
monitor can be inferred by
finding a gray value that
appears to have the same
intensity as the black and
white pattern.
We can find this a by a standard technique where we display a checkerboard
pattern of black and white pixels next to a square of gray pixels with input a
(Figure 3.11), then ask the user to adjust a (with a slider, for instance) until the two
sides match in average brightness. When you look at this image from a distance
(or without glasses if you are nearsighted), the two sides of the image will look
about the same when a is producing an intensity halfway between black and white.
This is because the blurred checkerboard is mixing even numbers of white and
black pixels so the overall effect is a uniform color halfway between white and
black.
Once we know γ, we can gamma correct our input so that a value of a =0.5
is displayed with intensity halfway between black and white. This is done with
the transformation
For monitors with analog
interfaces, which have dif-
ficulty changing intensity
rapidly along the horizontal
direction, horizontal black
and white stripes work bet-
ter than a checkerboard.
a
= a
1
γ
.
When this formula is plugged into Equation (3.1) we get
displayed intensity =(a
)
γ
=
a
1
γ
γ
(maximum intensity)
= a(maximum intensity).
Another important characteristic of real displays is that they take quantized input
values. So while we can manipulate intensities in the floating point range [0, 1],
the detailed input to a monitor is a fixed-size integer. The most common range for
this integer is 0–255 which can be held in 8 bits of storage. This means that the
possible values for a are not any number in [0, 1] but instead
possible values for a =
0
255
,
1
255
,
2
255
,...,
254
255
,
255
255
.
This means the possible displayed intensity values are approximately
M
0
255
γ
,M
1
255
γ
,M
2
255
γ
,...,M
254
255
γ
,M
255
255
γ
,