Return to Computer Vision Notebooks

Compositing Operators



Methods for combining and mixing images.

0. Input images


Given the input images $A$ and $B$ (sRGB colorspace).

p.s.: All the input images are normalized between 0-1.

1. Alpha compositing operators


1.1. Over


$$ \large O = A\alpha+B(1-\alpha) $$

1.2. Atop


$$ \large O = A\beta+B(1-\alpha) $$

1.3. Conjoint over


$$ \large O = \begin{cases} A &, \text{if } \alpha > \beta \\ A+\frac{B(1-\alpha)}{\beta} &, \text{otherwise} \end{cases} $$

1.4. Disjoint over


$$ \large O = \begin{cases} A+B &, \text{if } \alpha+\beta < 1 \\ A+\frac{B(1-\alpha)}{\beta} &, \text{otherwise} \end{cases} $$

1.5. In


$$ \large O = A\beta $$