Odd alpha-over result bringing compositor scene into VSE

I’m trying to do a chroma key, with the background coming from some strips in VSE. When I set the compositor scene strip to “alpha over” it doesn’t do what I expect. Instead, some of the “alpha-ed out” part of the image from the compositor gets through. To demonstrate the problem, I came up with a simplified version…

I set up a compositor scene thus:

So my “concentric circles” image goes to “Image” on the composite node, and the black rectangle mask goes to “Alpha”. I made sure the render properties say Alpha: Transparent.

If I render from the compositor to a PNG file, I get what you’d expect, namely concentric circles with a rectangular transparent area in the middle:


So far, so good. Now I create another scene, and in VSE add:

  • track 2 = scene / my compositor scene
  • track 1 = solid blue image

I set the compositor scene’s “Blend” to “Alpha Over”. I would expect to see concentric circles with a solid blue rectangle in the middle. Instead, if I render a frame from VSE, I get:


It’s acting like the alpha is something like 0.7 instead of 0.0, except that the full saturation of the underlying blue gets through.

If I set the compositor scene strip’s blend to “Replace”, it looks like it should – rectangular area of checkerboard in the middle. The problem only appears when I try to use “alpha over”.

If instead of bringing the compositor scene into VSE, I render to PNG from the compositor, then bring the PNG file into VSE, everything works as it should – the blue rectangle appears. I really don’t want to render over 12 thousand PNG files for my project, though, so I’m really hoping there’s a way to make it work with a scene-strip for the compositor output.

Why doesn’t solid blue show through for the parts of the compositor output that should have alpha=0?

Thanks in advance for being patient and kind if it turns out (as is often the case) that I’ve missed something obvious.

Looks like a bug to me. You seem to be doing everything correctly but Alpha isn’t being handled correctly. Perhaps post a .blend to try and then submit to bug tracker.

Here’s the .blend file, with the two PNG images bound in.

compositorAlpha_internalAssets.blend (1010 KB)

Well, I have solved it, although the solution is not at all intuitive (to me, at least), and kind-of clunky. Searching the bug database for “compositor alpha” I came across a lot of tickets with statements like:
Compositor works with premtiplied linear colors, sequencer works in straight display space colors.

I played around with converters in the Compositor, and came up with:



I have combined the alpha into an image, then converted “Straight to Premul”. To me, that sounds backwards to the statements in the tickets, but it’s what I found worked. I went back to my original chroma key project, and the same trick worked there.

Attachments

compositorAlpha_internalAssets_premultConvert.blend (1.04 MB)