5.7 Opacity and Transparency
Transparency is usually not considered to be a blending mode, however,
it works just like one! Transparency is just a combination of the
Multiply and Addition blending modes; it takes a
percentage of the foreground and adds it to the complementary
percentage of the background. Thus, if you want the foreground to be
75% opaque (opacity is just the opposite of transparency), you
multiply the foreground by 0.75, the background by (1-0.75), and add
the two. This relationship can be expressed as
represents the opacity. The percentages used in
scaling the foreground and background pixels are called complementary
By the way, can you guess why the percentage of opacity is represented
by the Greek letter alpha in the preceding equation? It is because
the opacity of a layer is controlled by its alpha channel. The alpha
channel takes values in the range [0,255] where a value of 255
represents 100% opacity, and 0 represents 100% transparency.
Different amounts of transparency/opacity can be obtained by adjusting
the value of .
For a foreground and background pixel pair, the
effect of opacity can be illustrated in the RGB cube.
Explanation of Opacity in the RGB Cube
shows how combining a percentage of the foreground with a
complementary percentage of the background creates a resultant pixel
that is somewhere on a line between the two points. The two blue
arrows in Figure
show the locations
in the RGB cube of a foreground and background pixel. The line
between the two points represents the set of pixels obtained for
varying degrees of opacity. The three red arrows show the pixels
corresponding to 25, 50, and 75% opacity of the foreground with
respect to the background pixel.
An Example Application of Transparency
illustrates an example of setting the opacity of a layer.
(a) shows a two-layer image
consisting of herons in the upper layer and flowers in the lower.
When the Opacity slider for the upper layer is set to 75%, as shown
in the Layers dialog in Figure
the result is as shown in Figure
Transparency/opacity can also be controlled for the GIMP's painting
functions. The Opacity slider for these are found in the Brush