This is a short introductory tutorial on custom Compositing masks in Blender, which are very useful for applying effects only to specific parts of an image.
Video Transcript
Hello everyone! This is a short introductory tutorial on custom Compositing masks in Blender, which are very useful for applying effects only to specific parts of an image.
In some tutorials previously published on the channel, I showed how to create and move Box or Ellipse-type masks. I did this, for example, in the tutorials on volumetric lighting or photogrammetry, where these basic types of masks were sufficient for my purposes. The masks we’ll see in this tutorial, however, offer much more freedom in defining shapes, though they require a few extra steps to set up.
First, I set the image I want to apply the mask to as the Input Image in the Compositing setup, and I connected it to both the Composite node and the Viewer node. The Viewer node is important because it lets us preview the effects both in the Backdrop of the Compositor Editor and in the Image Editor, since it’s in the Image Editor that we’ll need to go to define a mask object.

I switch the Compositor Editor to an Image Editor and set the Viewer Node as the image to display.

Using the Mode selector in the header of the Image Editor, I change the mode from View to Mask. Next to the image slot, a new slot for masks and a button labeled New will now appear.


By clicking New, we’ll create the first mask, which will be listed in the dropdown menu beside it and can be renamed as we like.

At this point, we’ve created a new mask layer, but it’s still empty, in the sense that no actual masks have been defined yet. To add one, we can click on the Add menu or use the shortcut SHIFT A.

We immediately notice that only two initial shapes are available: a circle and a square. But don’t worry: regardless of which one we choose, we’ll be able to freely move the control points of these shapes, much like we would with Curves objects.
These shapes are actual Blender objects, so we can duplicate, move, rotate, scale, and generally modify them using the same commands we’d use for Blender’s Curve objects.
The difference between the Circle and Square objects, aside from their initial shapes, lies in the fact that the Circle comes with handles for its control points, allowing us to create curved shapes, while the Square’s control points are connected by straight segments. This difference isn’t fixed, though: we can select one or more control points on either shape, press the V key or right-click, and change the handle type of the selected points.

In a Circle, for example, we can change a control point to Vector so that its handles always point toward the connected Control Points, while in a Square, we can change one or more points to Free to adjust the shape however we like.
Even though I’ve added multiple masks, I’m still working within the same initial Mask object or layer. All of these shapes will be used when this mask is referenced in a node within the Compositing setup. However, you can create additional Mask objects with different shapes and use them in different nodes if your project requires it.
To add a new mask object, click on Copy next to the mask’s name. To remove a mask object, just click on the X icon, of course.

Before switching back to the Compositing window to show you how to use these masks in the Compositor, I want to point out that it’s possible to insert Keyframes for the mask shapes, which means their shapes can be animated. To do this, simply select the control points you want to animate and press the I key on the frames you want to keyframe.

OK, so we now have a single Mask layer, which by default is named Mask. Let’s go back to the Compositor Editor to see how to add and use masks in the Compositor!
The Mask node we need isn’t located under the Masks group in the Add menu, but under the Input group, because it doesn’t have any input sockets. It simply provides data already present in Blender.

By default, the node doesn’t load any mask for its input, even if we’ve already defined one in the Image Editor. So we’ll need to choose the mask we want to use from the node’s Browse Mask selector.

The only output is the actual mask itself, which can then be used as a Factor to drive other effects within the Compositing setup.

As you can see, the mask wasn’t applied correctly. This is because the project resolution is different from the resolution of the image being used, whose values can be viewed in the Sidebar of the Image Editor. So I change the project resolution in the Render tab of the Properties editor to match the resolution of the imported image. After a short moment, Blender will automatically update the setup, and the mask will be usable without any issues.



Alright, that’s it for this tutorial! Unlike most of my other video tutorials, a PDF version of this one is not currently available for download. However, you’ll find a link in the description to a page with PDF versions of many of my other video tutorials. In any case, this is a great time to subscribe to the channel and turn on notifications! See you soon!