Problems with transparencies
Often in applying overlays, or some other type of blend, we get unexpected results that can look wrong. Sometimes the cause may be the different formula used by CGG compared to those in Gimp or other software. Other times they are a result of setup or order as listed next.
Keep in mind that blends can be applied not only from the Patchbay but also as an Overlay plugin (see Overlay (Video)) and the Blend Algebra plugin see Blend Algebra and Blend Program.
Here are some factors that can lead to unexpected results:
- The colors of the 2 tracks that will be blended; we often consider only these channels to guess the final result.
- The Alpha channel of the 2 tracks that can interact with each other in ways that are intuitively (but not mathematically) unexpected.
- The choice of Source track and Destination track (top or bottom).
- Overlays effect generally depends on the colorspace of the project - YUV can differ from RGB. With the Blend Algebra plugin this dependency is addressed; the necessary colorspace conversion can be done automatically.
- Overlays can depend on implicit clipping. In RGBA-FLOAT no clipping is done; in RGBA8888 clipping to 8-bit unsigned cannot be avoided per definition. The Blend Algebra plugin addresses this dependency also, clipping for float colorspace can be switched on explicitly, and then the results for float and RGBA8888 should be identical.
- Unclipped overlays can be displayed differently depending on the graphic driver (X11, X11-Xv, X11-OpenGL, etc.). The OpenGL driver could be more robust in these cases; it runs perhaps under control of some CINELERRA-GG shader and seems to clip the bounds correctly. However, all rendering is done in software without the use of OpenGL so be sure to check results without OpenGL.
- The presence of a third black background track, (or even the color of the Composer Background Color, which in CINELERRA-GG is black by default but whose color can be varied manually) which can interfere with viewing the blend in the Compositor and show unexpected results (see MantisBT #559).
- If the footage material in a track has transparency by itself, it might be modified by overlay formula and develop some color hidden by transparency before overlay was applied.
- Overlays can be applied at two places: via the Overlay plugin or the Blend Algebra plugin
in which sequence in the video processing pipeline plugins are processed, is defined; and in the Patchbay in which sequence in the video processing pipeline plugins are processed, is not defined.
- There may be masks. The mask can be applied either after plugins, or before them. Results of the Overlay plugin depend on it.
- There is fader control. Probably, fader is applied after all plugins and overlays, but this order has not been verified.
- There are two buttons in the patchbay, Play track (can be switched off) and Don't send to output (can be switched on). In both cases video from the affected track disappears, but the background left is different in both cases.
- Effects from some other plugins can have transparent parts (Titler, for example).
Ultimately, if we get a result that looks wrong to us, we need to look at the formula for that blend and calculate our mathematical result. Then compare our calculation with the result we see on the screen.
In principle, you could attach Blend Algebra in addition to Overlay plugin, switch one of them on, another off, change the formula in Blend Algebra and see how the modifications affect the result, and even print and analyze the intermediate color values. This can be most helpful if you use some specially drawn regular color patterns instead of your working footage.
Another possibility is to attach the Blend Program plugin which modifies any given tracks directly.
The CINELERRA-GG Community, 2021
https://www.cinelerra-gg.org