Specifications
Intel
®
Image Processing Library Reference Manual
5-22
5
Table 5-2 Types of Image Compositing Operations
Type Output Pixel
(see Note)
Output Pixel
(pre-mult. α
αα
α)
Resultant
Alpha Description
OVER
α
A
*A+
(1-[α
A
)*α
B
*B
A+(1-α
A
)*B α
A
+
(1-[α
A
)*[α
B
AoccludesB
IN
α
A
*A*[α
B
A*α
B
α
A
*[α
B
A within B. A acts as a
matte for B. A shows only
where B is visible.
OUT
α
A
*A*(1-[α
B
)A*(1-[α
B
) α
A
*(1-[α
B
)
A outside B. NOT-B acts as
a matte for A. A shows only
where B is not visible.
ATOP
α
A
*A*[α
B
+
(1-[α
A
)*α
B
*B
A*[α
B
+
(1-[α
A
)*B
α
A
*[α
B
+
(1-[α
A
)*[α
B
Combination of (A IN B) and
(B OUT A). B is both back-
ground and matte for A.
XOR
α
A
*A*(1-α
B
)+
(1-[α
A
)*[α
B
*B
A*(1-[α
B
)+
(1-[α
A
)*B
α
A
*(1-[α
B
)+
(1-[α
A
)*[α
B
Combination of (A OUT B)
and (B OUT A). A and B
mutually exclude each
other.
PLUS
α
A
*A + α
B
*B
A+B
α
A
+ α
B
Blend without precedence
NOTE. In Table 5-2, the resultant pixel value is divided by the resultant
alpha when
divideMode
is set to true (see the argument descriptions for
the iplAlphaComposite() function). The Greek letter
α
[[here and below
denotes normalized (scaled) alpha values in the range 0 to 1.
For example, for the OVER operation, the output C for each pixel in the
inputs A and B is determined as
C=α
A
*A +(1- α
A
)*α
B
*B