Simple outline behind a picture-in-picture?

I have a seemingly simple issue:

I have a video that pops up in the corner of a render, picture-in-picture style. (It grows and moves throughout the video.) My goal is to simply have a black outline behind the video. I’m using the Compositor because, normally, black outlines are very simple: a Dilate/Erode Node, followed by a Set Alpha Node. Check out the Monkey and Cube below to see how perfectly this works for objects from the 3D View.

However, for some bizarre reason, with the VIDEO…the Dilate/Erode generates all sorts of weird alpha values and such. Thus, I have found it impossible to generate a solid outline. (Again, see the picture below.)

I have attached a .Blend. Thanks, as always.


Attachments

untitled.blend (639 KB)

Well, I “solved” it. I don’t even fully understand what all of this is doing, but I was just going hog-wild with different combinations of Nodes and I finally found a combination that works:


Well the rendered sources had explicit alpha channels but the video one was derived from the luma value. I downloaded the .blend and placed another high contrast video in there and had the same issues. So the ramp you place in there creates a hi con black and white alpha from the scaled/translated video. This may not always work, it just depends on the nature of your source video luma levels. Mine had some 0 value black and therefore didn’t work right (had a hole in the middle).

Well then, if you can think of anything which would work in all situations, that’d be great. I’m absolutely stunned that simply outlining something in the Node Editor was so difficult to do. So I expect that a universal solution would be popular with many users.

Instead you should just split off the alpha with a Convert node “Separate R,G,B,A”, way back after the transform stage then use the alpha channel for the dilate erode function.


1 Like

3PE,

I tried every permutation of Separate/Combine RGBA Nodes that I could think of. I got nowhere. If you can provide a sample, I’d be happy to look at it.

Sorry I edited my earlier post. Check it out. I did notice that the scale node stopped working. Maybe the separate nodes also failed?

3PE,

Your method is indeed working, and it’s simpler than mine, and appears more universally applicable than my method. (Actually, there were some speckly-artifacts with my method, too, that are gone now.) My mistake had been putting a Combine RGBA Node after the Separate RGBA Node.

Anyway, thanks. This seems to be about perfect!

Yippee. Glad it’s working ok.