3
$\begingroup$

Can I use blender to take an existing jpeg image and mask certain areas out of that image?

I'm still very new to Blender and I've searched this topic, but all Q&A's seem to be about masking objects in a 3D setting. I'm wondering about masking a certain part of a 2D image so that I can use the image as a background on an animation, such that the elements of my animation show "through" the masked out areas.

Any help would be appreciated. Thank you for reading.

$\endgroup$
2
  • $\begingroup$ You can also paint an alpha channel into the object's image texture slots. Another crude way is to heavily subdivide the mesh and delete all the faces you want to have masked out. $\endgroup$
    – 3pointedit
    Commented Oct 17, 2016 at 23:02
  • $\begingroup$ Why don't you use Photoshop for masking? That could be easier and perfect than any others. I always prefer Photoshop for this kind of editing. $\endgroup$ Commented Jan 17, 2017 at 9:51

3 Answers 3

5
$\begingroup$

Blender's compositor can be used to mix together video and still images. The render output of a 3d scene doesn't have to be used in the compositor, any image or video can be input and placed on top of another using a mix node.

A transform node can move and resize the image. A mask can then be used to cut out part of the image you are adding, box and ellipse mask nodes are available in the compositor, you can also create odd shaped masks in the UV/Image editor which can be animated if you want the mask to move or distort over time.

sample compositor

$\endgroup$
2
  • $\begingroup$ is there some easier way to set the dimensions of the box mask node besides guessing at X,Y, width, and height values? maybe something where I can drag it with the mouse? $\endgroup$
    – Michael
    Commented Apr 4, 2020 at 22:06
  • 1
    $\begingroup$ @Michael connect a viewer node and either show the background image or show the viewer node in the image editor, dragging the values will update live. Use Shift to slow down to value changes. $\endgroup$
    – sambler
    Commented Apr 19, 2020 at 4:49
1
$\begingroup$

1 - Import your photo as "Image as planes", create an object for masking purposes and assign him the "Wire" maximun display; set a rendering size (maybe the same as the photo), create a camera, set it to "ortographic view", clear her position and rotation (ALT G, ALT R), move it on the Z axis to have it over the photo (distance doesn't matter in ortographic view, control the size of your camera view with the "ortographic scale" instead).

enter image description here

2 - Press numpad 0 to enter camera view, adjust the mask, assign the mask to layer 2, create a new render layer, assign layer 1 to render layer 1 and L2 to RL2; assign an emission material to both the object (cycles) or shadeless (BI), intensity 1, color of the mask pure white, turn off any kind of lighting and render the scene.

enter image description here

3 - Switch to the compositor, duplicate the render layer node and set his output to Render Layer 2 (the mask). Use this output to control a "set alpha" node. Normalize is for assuring that black is pure black and white pure white; Invert to invert the effect of the mask; Fast Gaussian blur to have some "Feather edges" effect.

Works also with movies and animated masks!

enter image description here

$\endgroup$
-4
$\begingroup$

This is probably a problem you can solve using the compositor. Although I would do the "masking" using GIMP and save the modified image as a PNG for use in the compositor.

https://www.blender.org/manual/compositing/introduction.html

$\endgroup$
2
  • 1
    $\begingroup$ I don't think this really answers the question unless you specify how you do this in the compositor. $\endgroup$ Commented Sep 16, 2016 at 19:33
  • $\begingroup$ @Mutant Bob, OK I will give both the compositor and GIMP a try. I always think the more techniques I learn the better. Thank you so much for posting the link. $\endgroup$
    – JakJak
    Commented Sep 16, 2016 at 20:24

You must log in to answer this question.

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