From BlenderWiki

Jump to: navigation, search

Garbage Masking

Garbage masking is the process of quickly removing unwanted parts from an image so that it's easier to composite with your other images. The mask we are going to create will remove the rigging and the wires from our original green screen clip so that we can cleanly overlay it over the background

There are various techniques for masking. Some require more time, skill, and precision than others and have their efficiencies in certain contexts. In this particular example we eliminate part of the image which is obviously unnecessary and large, rather motionless, and with simple edges that are easily seen. The elimination can can easily be drawn with blender tools in a short period of time. Quick, Simple and Wholesome(not dirty) drawing here with very little mathematical skills or dexterity needed. Garbage masking is a technique and phrase and is not listed on any blender menu.

Initial Shot

Raw Footage

Here you can see our initial shot of our super here as it was originally filmed in front of a green screen. You'll notice that there is some extra material in the shot outside of the green screen so we'll will use a garbage mask to remove that from our composite shot.

Blender setup

Camera Setup

There are several things to setup in blender to make sure that the garbage mask comes out correctly. To setup the workspace we'll start with a fresh blend file. Starting with a new file, erase the default lamp and cube, then move the camera over the origin. I find it's easiest to do this with the Transform Properties panel (press N with the camera selected) then set the locations and rotations to 0.

IPO Screen

Then press 0 NumPad to look through the camera. I like to then split up the main 3D window so that I have a camera view and an IPO view above the buttons so that I can see the keys as I'm working. Now we're ready to start creating a garbage mask.

Render output and Resolution

Render Settings

First thing to do is to make sure that the resolution of the rendered matte matches the image resolution that you are using for your video or everything won't line up properly. The video's resolution is 320x240, so we need to set this in the render panel options. Also in the render settings we can turn off OSA, Ray tracing, Environment Mapping, and Shadows since we are producing a simple black and white image that will be used as a mask to clip out the unwanted parts of our original clip. Also we must match the frame rate of our original clip. Since the original clip is 15 fps we will set our render settings to match.

Be sure to set the output image type and render path. I like to keep everything separate, so we'll create a garbage mask directory to store our files in from this render. I also find that image sequences are easier to work with so we'll render those.

Set the sky

Setting up the sky to a solid black helps so that you have one less object to worry about when creating your mask. Go to the materials panel (press F5) and then the world settings and change the sky to pure black by changing the horizon and zenith colors to black

video background

Next we need our video background to work with. Thanks to Ton's work on the image re factor it is very easy to set this up.

In the 3D-view, select from the view menu the background settings. Press the use background button and click the load button. Go to the directory where you keep your background image/video and select the first image in a sequence or your movie. Be sure to select what type of image (still/sequence/movie) in the image window and set the number of frames if it is an image sequence. You also want to enable "Auto Refresh" in the background panel. If your sequence of images is not visible, be sure that the number of fames is correct and check the console window for errors.

Press and to flip through your video to make sure that it is set up properly.


Primary Colors

Since the garbage mask determines what is visible by whether it is white or black we will need two primary colors. Lets make two simple materials, one for each. We need to be sure that we set them to shadeless so that we get only the true color from them. We'll call them mask_white and mask_black just for grins. Be sure to press the "F" button next to the material name so that they have a fake user. This will prevent them from being erased when the file is saved if we have not used them yet.

Rough Mask

Mask On

Let's make a rough mask to block out the area that is actually green screened. It will only be one frame for this mask through this shot. We will come back and create a finer garbage mask in a later tutorial. Start by making a bezier circle that encompasses the entire area of action but does not include any of the non-green screen stuff that we don' want in the shot. You may need to subdivide it to get enough control points for the circle. Set the material of the circle to mask_white. Be sure to use the up and down arrows to see how Super-Wu Man moves and that the circle fits for the entire clip.


Rough Garbage Matte Image

Here is my image that I came up with. We will use this in a later tutorial on green screening.