Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Alpha compositing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Description== In a 2D image a color combination is stored for each picture element (pixel), often a combination of red, green and blue ([[RGB color model|RGB]]). When alpha compositing is in use, each pixel has an additional numeric value stored in its '''alpha channel''', with a value ranging from 0 to 1. A value of 0 means that the pixel is fully [[transparency and translucency|transparent]] and the color in the pixel beneath will show through. A value of 1 means that the pixel is fully opaque. With the existence of an alpha channel, it is possible to express compositing image operations using a ''compositing algebra''. For example, given two images ''A'' and ''B'', the most common compositing operation is to combine the images so that ''A'' appears in the foreground and ''B'' appears in the background. This can be expressed as ''A'' '''over''' ''B''. In addition to '''over''', Porter and Duff<ref name=Duff/> defined the compositing operators '''in''', '''held out by''' (the phrase refers to [[Matte (filmmaking)#Garbage and holdout mattes|holdout matting]] and is usually abbreviated '''out'''), '''atop''', and '''xor''' (and the reverse operators '''rover''', '''rin''', '''rout''', and '''ratop''') from a consideration of choices in blending the colors of two pixels when their coverage is, conceptually, overlaid orthogonally: [[Image:Alpha compositing.svg]] As an example, the '''over''' operator can be accomplished by applying the following formula to each pixel:<ref name=Wallace/> :<math>\begin{align}\alpha_o &= \phantom{~C_a}\alpha_a + \phantom{C_b}\alpha_b(1 - \alpha_a) \\ C_o &= \frac{ C_a \alpha_a + C_b \alpha_b (1 - \alpha_a) }{\alpha_o} \end{align}</math> Here <math>C_o</math>, <math>C_a</math> and <math>C_b</math> stand for the color components of the pixels in the result of the "over", image A, and image B respectively, applied to each color channel (red/green/blue) individually, whereas <math>\alpha_o</math>, <math>\alpha_a</math> and <math>\alpha_b</math> are the alpha values of the respective pixels. The '''over''' operator is, in effect, the normal painting operation (see [[Painter's algorithm]]). The '''in''' and '''out''' operators are the alpha compositing equivalent of [[Clipping path|clipping]]. The two use only the alpha channel of the second image and ignore the color components. In addition, '''plus''' defines additive blending.<ref name=Duff/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)