3
$\begingroup$

I am attempting to make a video output from Blender which has the (1) video natural to the left side, and (2) a black and white alpha mask on the right side, kind of like this but L/R instead of top/bottom:

enter image description here

To do this I need to accomplish two steps

1) Make the canvas (render output pixel dimensions) twice as wide as usual.

The first way I tried this would have been ideal: I read here that you can use a Mix node and here that you can use a Mask node to define the output canvas size.

So in theory you can set the Mask node to twice the width of your render, input this into the first Mix node, and input your actual render into the second of the mix node, and you will get twice the canvas on output. This looked correct in the node editor (the Composite preview was the correct double width) but when I tried Render it was still not twice the width there (even viewing composite in the render window).

Is this a bug? This would be a nice way of doing it. But this failed.

Alternatively, I can set the right panel Resolution X to twice what it should be and Aspect X = 1, Y = 2, then apply a 50% X scale to my render. This is the best I can come up with:

enter image description here

Here we can see (the unchanged default cube is at the center) I have distorted the output on the right panel to give twice the canvas width to work with, then scaled the output from this by X =0.5 to regain natural dimensions, and translated the image and alpha to move them to each of the sides I want (image on left, mask on right).

2) Combine the two outputs into one

I tried splitting channels, using a color ramp (if I had x-position of pixels and image width I could use this I think somehow to make the ramp mix one to the other?.. but I don't know how...), and doing various addition/subtraction.

However, I could not get an output that was perfectly the natural render on the left, and just the mask on the right.

GOAL

I might ideally want two solutions: (i) with a black background on the left ("pre-multiplied"?) and (ii) with transparent background on the left. In both cases we would have just the black/white mask on the right either way.

Test project is here:

Any solution or ideas?

$\endgroup$

1 Answer 1

6
$\begingroup$

If one of your layers is transparent (here the main render), you can simply use an Alpha Over node. Basically, it puts the 2nd input above the 1st input, based on the alpha channel of 2nd input.

enter image description here

I've cropped the B&W image, so that it doesn't appear below the render. You can just disable the Crop node by pressing M (mute) when selected.

Tips

  • You can Ctrl+Maj+Click on a node to see the preview.
  • If you have multiple Composite nodes, only the active one will be used (meaning the last one selected).
  • Premultiply is about whether your keep the color information (RGB) in the transparent part (A) of the image or not. If you ever have a dark edge or bright edge around a shape when compositing multiple image, it would probably be because of premultiply not set correctly.

If you need the final output resolution to be different from the render resolution, you can use a File Output. It will save the input to some file you have to setup. Remember that Blender will keep saving your Composite output even if you save something else with the file output.

And here is the blend file :

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .