Our
latest plug-in was released and announced at Photoshop World in
Miami at the beginning
of October,
with great success. The director of photography for a major U.S.
corporation said it was the best software he saw at the show besides
Photoshop CS itself. The shift and gain filters in this plug-in were
taken directly from Asiva Photo's Shift and Gain Operations. The
following discussion about shift and gain applies to the Shift+Gain
plug-in as well as Asiva Photo’s Shift and Gain Operation.
Lets
get past the basic terms that seem to confuse users: shift and
gain. In the context of digital image processing, shift
means to add
or subtract an amount to or from a given component of a digital image.
For example, shift the red component (or channel) by 6,000 would
mean to add 6,000 to the red component for every pixel. We
are assuming
a 16-bit representation, of course, where the red, green, and blue
channels for each pixel are each represented by a value ranging from
0 to 65,535. Shift red -6,000 would conversely subtract 6,000. What
does this do though? If we were to look at the red component on
a histogram, it might look something like this:
Shifting
red by +6,000 would result in the histogram looking like:
But
what does the image look like? In our example, the image would
not only get redder, but would increase in brightness
as well,
since working in RGB changes color as well as light level.
Everything would
get redder, especially those pixels that were already primarily
red in hue.
Shifting
the value or luminance component is like the brightness adjustment
on a TV - everything in the image will get brighter
or darker.
Gain
behaves quite differently from shift. Gaining the value component
with Asiva gain is basically similar to a TV's contrast adjustment.
Gain
is really no more than multiplying values or dividing them
by some number. If brighter values are represented by higher
numbers and
darker values are represented by low numbers, then multiplying
by the same
amount would impact the HIGHER number more than the lower
numbers. That is why it appears to increase the contrast - because
the
whites get whiter but the shadows stay almost the same. Taking
the same histogram example above, lets say we will gain the red
channel by 1.5. This means multiply all red pixel components
by 1.5. For pixels that have relatively high red values, the
red will
get redder, but for pixels whose red values are small the red
increase is minimal. On a histogram we would see:
Basically
we have stretched the histogram to the right, anchored from the
very left side (the 0 value of red). Notice that
the ‘hump’ has
reduced in size. That is because many of the pixels that
made up the ‘hump’ are
now towards the right side of the histogram.
The
left side has not moved like a shift would produce. That is because
a sift will modify all component values the
same amount, regardless
or their original values. A gain, on the other hand, will
always affect high values more than low values. This is
true whether
you
are gaining
up (multiplying) or gaining down (dividing).
In
the most general sense, if you want to impact high values of
some component or channel but not so too low values, use
gain. If you
need
to alter low values, typically to increase them, use
shift.
In
next month's newsletter, we will give very specific examples for
the appropriate use of the Asiva Shift
and Gain Operations. |