Thursday, 17 January 2013

Brightness: Gamma


Brightness: Gamma

As you adjust the Input Black and White values, you
may have noticed the third caret that maintains its place
between them. This is the Gamma control, affecting
midtones (the middle gray point in the gradient) at the
highest proportion and black and white, not at all. Adjust it
over the gradient and notice that you can push the grays in
the image brighter (by moving it to the left) or darker (to
the right) without changing the black and white levels.
Many images have healthy contrast, but a gamma boost
gives them extra punch. Similarly, an image that looks a
bit too “hot” may be instantly adjusted simply by lowering
gamma. As you progress through the book, you will see
that it plays a crucial role not only in color adjustment
but also in the inner workings of the image pipeline itself
(more on that in Chapter 11).

In most cases, the histogram won’t itself offer much of a
clue as to whether the gamma needs adjusting, or by how
much (see “Problem Solving using the Histogram,” later in
this chapter for more on the topic). The image itself provides
a better guide for how to adjust gamma (Figure 5.8).
So what is your guideline for how much you should adjust
gamma, if at all? I fi rst learned to adjust too far before
dialing back, which is especially helpful when learning. An
even more powerful gamma adjustment tool that scares
most novice artists away is Curves (more on this later).
By mixing these fi ve controls together, have we covered
everything there is to know about using Levels? No—
because there are not, in fact, fi ve basic controls in Levels
(Input and Output White and Black plus Gamma), but
instead, fi ve times fi ve (RGB, Red, Green, Blue, and Alpha).


Geek Alert: What Is Gamma, Anyway?

It would be so nice simply to say, “gamma is the
midpoint of your color range” and leave it at that.
The more accurate the discussion of gamma
becomes, the more obscure and mathematical
it gets. There are plenty of artists out there who
understand gamma intuitively and are able to
work with it without knowing the math behind
it—but here it is anyhow, just in case.
Gamma adjustment shifts the midpoint of a color
range without affecting the black or white points.
This is done by taking a pixel value and raising it to
the inverse power of the gamma value:
newPixel = pixel (1/gamma)
You’re probably used to thinking of pixel values
as fitting into the range 0 to 255, but this formula
works with values normalized to 1. In other words,
all 255 8-bit values occur between 0 and 1, so 0 is
0, 255 is 1, and 128 is .5—which is how the math
“normally” operates behind the scenes.
Why does it work this way? Because of the magic of
logarithms: Any number to the power of 0 is 1, any
number to the power of 1 is itself, and any fractional
value (less than 1) raised to a higher power
approaches 0 without ever reaching it. Lower the
power closer to 0 and the value approaches 1,
again without ever reaching it. Not only that, but
the values distribute proportionally, along a curve,
so the closer an initial value is to pure black (0) or
pure white (1) the less









No comments:

Post a Comment