Tips and Techniques/ApplyModes
From VFXPedia
Understanding of the math used in the Merge tool for combining two images lets you work in a more efficient way getting predictable results instead of random experiments.
It's also important to fix arising problems in a quick yet correct way.
This is an explanation of how exactly different apply modes work and when they are suitable.
Normal
In this mode, the Merge offers an extra Subtractive/Additive control which lets you select the type of compositing or even make a mix between the types.
The formulas of the Normal mode are:
Result Color = [Background Color * (1 - Foreground Alpha * Alpha Gain * (1 - Burn In))] + Foreground Color * Foreground Alpha * Alpha Gain - for subtractive
Result Color = [Background Color * (1 - Foreground Alpha * Alpha Gain * (1 - Burn In))] + Foreground Color - for additive
As you can see, the difference between the subtractive and additive formulas is that in additive one, the foreground doesn't get multiplied by its alpha.
The additive approach is used in 3D and professional compositing software. Additive compositing implies your images are pre-multiplied by Alpha, which normally means that completely transparent areas are black (0 in Alpha corresponds to 0, 0, 0 in R, G, B).
Subtractive approach is mostly used in editing software, Adobe-ware and other programs working in low color depth. It operates by "un-premultiplied", or pre-divided by Alpha images (depending on the way the Alpha was created). In such images the color extends beyond object edges and in semi-transparent areas it has the same values as in completely opaque ones. The pre-multiplication by Alpha is performed on the fly while putting the layers together. A benefit of this workflow is that all the color tools operate the values unaffected by transparency (straight colors), so highlights remain highlights and shadows remain shadows regardless of how transparent or blurred the object is. In software which processes images in 32 bit per channel mode, it's easily fixed with pre-dividing by Alpha (sometimes funny called un-premultiplying), but in 8-bit or 16 bit integer processing mode you will experience color distortions while performing sequential divisions and multiplications due to rounding losses.
Fusion supports both modes as it's capable of working in multiple color depth.
As you can conclude from the Additive formula, if you set the Alpha Gain = 0, you will get a pure addition of the Background and Foreground color. Foreground Alpha is completely ignored in this case (zeroed).
If you set Burn In = 1, the result in the color channels will be the same (pure addition), but the Foreground Alpha is also added to the Background alpha. Most of the time it's not desired as adding two images with Alpha together, you will get Alpha > 1 (Alpha = 2 in completely opaque areas).
But thee is a case when such handling of the alpha is preferable. Imagine, that you separate your image onto two layers by cutting a part of it with a mask to process it separately. If you merge it back over the original in the Normal mode, you will get a semi-transparent border of the mask in the resulting image. This is because in the default Normal mode you first multiply the Background Color with inverted Foreground Alpha when you cut a part of the image and then do it again while pasting it on top.
Why not to leave the background layer intact while cutting a part of it as a foreground? Good question - simple answer: semi-transparent areas will reduce transparency twice and mix the original color with altered one.
Apply_Modes.comp
Draft article (to be continued). I'm using my research published once on www.render.ru as the basis.