Disjoint-over and Conjoint-over, explained.

Categories Nuke

Nuke’s merge node has 30 operations, and finding a Compositor who has utilized them all would be a difficult task. However, I want to shed some light on two merge operations that are incredibly useful, and don’t get as much love as they should.

The most common operation, Over, is pretty self-explanatory: The image in the A pipe goes over the top of the B pipe. So how and why would this concept need to be expanded upon?

When working with CG renders that have baked-in holdouts, or if you’re creating and precomping your own holdouts using Deeps, you might find that you get dark edges when merging everything back together. This is where disjoint-over can help! Let’s take a look at a quick example to demonstrate:

As you can see, we get a semi-transparent alpha channel at the join. This error is essentially a double-premultiplication (check out Conrad Olson’s video on premultiplication if this is a foreign concept); the X-Wing’s RGB channels are being multiplied by its own alpha channel, and the Star Destroyer is also using the X-Wing’s alpha to stencil the holdout, which is doubling it up that premultiplied edge. Disjoint-over accounts for this, giving you the alpha you’d expect:

disjoint-over’s algorithm: A+B(1-a)/b, A+B if a+b<1.

Conjoint-over does the opposite of disjoint-over — it accounts for unintended doubling-up of an alpha channel. You can use conjoint-over when combining two images that need to share one alpha channel wherever they overlap — think of it like A pixels always being on top of B pixels, but the alpha channel is max-ed.

For example, conjoint-over can be useful if you have many layers of semi-transparent FX elements sharing a similar alpha channel. Over-ing the FX layers together will eventually result in an overly-dense alpha, whereas conjoint-over can help you preserve the intended transparency.

conjoint-over’s algorithm: A+B(1-a)/b, A if a>b.

If you would like to play with an interactive example inside of Nuke, you may download this Nuke script.