Basic Greenscreen w/ Ramen HDR
Ramen HDR is a nodal compositing software created by Esteban Tovagliari. This write up will discuss using Ramen to pull a basic Greenscreen matte effect.
Nodal based compositing has some interesting advantages over layer based compositing software like Photoshop or After Effects. Similar to visual programming, a nodal compositor processes images in a flow, or node tree configuration. As the data moves along, different operations are performed upon the images. These results can be pulled out of the flow, operated on separately, and then reused 'down stream' for delicate control of your composite shot.
For learning compositing, I highly recommend Digital Compositing for Film and Video by Steven Wright. It is hands down my favorite compositing book. Most all of the techniques he teaches can be successfully used in Ramen.
Launch Ramen HDR.
Initially we need to get our Foreground Greenscreen shot into the program to begin working on it. The FG I'm using here comes from Hollywood Camerawork. They have an excellent series called "Special Effects for Directors". This series is highly recommended for learning the most commonly used techniques in special effects.
Hollywood Camerawork
Left click on the menu item labeled 'Create' then scroll down to 'Input' and finally over to the menu item 'Image'. A dialog box will come up, asking you which file you wish to open. Navigate to your Greenscreen shot and select it. Note that the 'sequence' check box should be ticked. (Uncheck this to import a single frame from a sequence.)
An Image In node appears in the composition. Congratulations, you've created your first (of many!) nodes in the data flow.


My image required some horizontal stretch to correct for a .9 pixel aspect ratio, so I added a 'Resize' node at this point. Your image may or may not require resizing or cropping. Add whatever node is required for your shot.
Next we do some processing tricks to smooth out the compression artifacts, or blockiness, that most DV footage and JPEG sequences have. This tip comes directly from Esteban, creator of Ramen. If you are using high resolution source footage, you might be able to skip these data nodes.
Left click on the menu item 'Create' then scroll down to 'Color' and finally over to 'Colorspace'. This new node will appear, automatically connected to the previous one. By default, the Colorspace node is set to convert RGB images to the YUV color space, so in your composition viewer, the image will look very strange. This is normal.
Left click on the menu item 'Create' then scroll down to 'Filter' and then to 'Blur Channels'. In the Inspector Panel, set the G (or Green) and B (or Blue) blur radius to 2 pixels. I also used 2 for the number of iterations.
Then left click on the menu item 'Create' then scroll down to 'Color' and finally over to 'Colorspace'. In the Inspector Panel set the mode of this node to 'YUV to RGB'. This should put the image back to normal, but with the Greenscreen "smoothed" to help reduce the compression artifacts.
Here is our progress so far:
Okay - full Disclosure here: Ramen has a 'Color Difference Key' node, but I won't be using it. The following technique comes from the Steve Wright book. Buy it. You won't be sorry!
So now we separate the color channels so we can begin creating our "Color Difference Matte". Left click on 'Create' then scroll down to 'Color' and finally over to the 'Channel Mixer' node. This node creates a monochrome (or gray scale) image, using various percentages of the Red, Green, and Blue color channels. We are going to set it for R = 1.0, G = 0.0, and B = 0.0. This basically zeros everything and gives us just the Red color channel. To help with organization, I entered "Red" into the Name box of the Inspector panel for this node.
Double click on the Colorspace_2 node to select it. Add another 'Channel Mixer' node. It will appear downstream from the Colorspace_2 node, and separate from, but right along side, the first 'Channel Mixer' node. In the Inspector panel, rename this node to Blue and then set it to R =0.0, G = 0.0, and B = 1.0.
Double click on the Colorspace_2 node to select it. Add another 'Channel Mixer' node. Rename it to Green and set the values accordingly. You've now separated the Red, Green, and Blue color channels so we can set up the difference between the colors to make our matte. By double clicking on each node in turn, you can inspect the monochrome version of your R, G, B color channels in the composition viewer.
Here's our node tree thus far:
As a point of interest, if this were a Blue screen shot, I would set up the Channel Mixer nodes with Green in the middle, and Blue on the right side.
As you can tell by now, when creating nodes, they will be added down stream from which ever node is currently selected. Double click on the Red 'Channel Mixer' node to select it. Left click on 'Create' then down to 'Layer' and finally over to 'Layer'. This creates a node that takes two inputs, and does a variety of operations on them.
Double click the 'Layer' node to select it. The composition viewer displays Color Bars, which is Ramen's way of saying that the node has not been connected properly, or is missing an input. Click and drag the output of the 'Blue' 'Channel Mixer' node down to the second input of the 'Layer' node. As soon as it is connected, we finally see an image in the composition viewer.
In the Inspector Panel, rename this node to 'Max' for Maximum value. Then set the Layer Mode to 'Max'. This node will compare the Red and Blue color channels, and pass to it's output, the maximum value of the two.
Double click on the 'Max' Layer node to select it. Then create another Layer node. Double click this new Layer node to select it. Drag the output from the 'Green' Channel Mixer node to the second input of this layer node. In the Inspector Panel rename this node to 'Subtract' and set the Layer Mode to 'Sub'. This subtracts maximum of the Red and the Blue from the Green, finally giving us our Color Difference Matte.


As it stands now, our matte isn't exactly ready for it's final use. If you scroll your cursor over the Composition Viewer, you'll see a display on the upper left. You can see that the pixel values are not exactly 0.0, or pure black, in the matte. Nor are they 1.0, or white, for the blue screen.
Our next step is to use curves to control the density in these areas.
Double click on the 'Subtract' node to select it. Left click on the 'Create' menu item, then scroll down to 'Color' and finally over to 'Curves'.
Double click this new node to select it. In the Animation Editor panel you'll see the graph of our 'Curve' Node. Hold down the Control Key and left click on the slope of the graph. This will add a new control point. Pull this point down to the bottom, and slide it to the right. Notice what happens to the darker tones within our matte. They go to pure black.
Control click on the graph again to add a new point. Slide it up and to the left. This may be a bit difficult, as this graph, being developed for animation, not matte processing, will not stop at 1. You'll have to judge it by eye. Notice what happens to the lighter areas of our matte. They got to pure white.
By adjusting the 'black' and 'white' point of the curve you control what areas will be matted out, what will remain, and the softness of the transition edge between the two.
How much will you adjust these points? This is where your eye as a compositor will have to be developed, but Ramen provides some tools to assist you. Move your cursor over the image and make sure that the read out above the Composition Viewer window shows a value of 1, 1, 1. Within the darkest areas of the matte, you want to see 0, 0, 0.
Now it's time to put our matte to use. Double click on the 'Curves' node to select it. Click on the menu item 'Create' then scroll down to 'Channel' and finally over to 'Invert'. This creates a node that inverts the values of our matte, giving us a counter-matte.
Now we remove the green backing from the foreground. Double click on the 'Invert' node to select it. Click on the menu item 'Create' then scroll down to 'Layer' and finally over to 'Layer'. Connect the original 'Image In' node (yes, from way back at the beginning) to the second input of this layer node. In the Inspector Panel set the layer mode to 'Mult' for multiply.


Instantly the Green backing goes dark. The value of zero, multiplied by the green value equals zero!
Now we'll add our background image. Double click anywhere in the gray area around the composition data tree to deselect ALL the nodes. Click on the menu item 'Create' and scroll down to 'Input' and finally over to 'Image'. As before a dialog box will open. Navigate to, and select, your background, either as a still image or moving footage.
This background may, or may not, be the same size as your Greenscreen element. If necessary add a 'Resize' node to change the size.
Now it's time to multiply the background by our matte. Double click on the last node beneath the second 'Image In' node (or the node itself if there's only one) to select it. Click on the menu item labeled 'Create' then scroll down to 'Layer' and finally over to 'Layer'. Connect the original matte by clicking and dragging from the output of the Curves node, to the second input of the Layer node. As before, set the layer mode to 'Mult'.
A dark area the shape of our matte will appear over our background.


Almost there. Now we have to merge the foreground and background together, and output the final result.
Double click on the 'Layer' node we just created to select it. Add another 'Layer' node (of course by now you know how to do this).
Click and drag the output of the matted foreground node (the other Layer node) to the input of this new Layer node. Set this Node's Layer Mode to Add. The foreground should now appear over the background.


Double click on this last node to select it. Now click on the menu item labeled 'Create' and scroll down to 'Output' and finally over to 'Image'. In the Inspector Panel for this node you can name the output file, navigate and set the folder you want to render to, and set file options for your final output.
That should do it. You now have your Greenscreen element matted over your background. That's very basic, but if your image is anything like mine, there will be horrible fringing around the foreground subject. Let's fix this.
Hold the Control Key and Left Click on the connection between the matted foreground and the last Layer node (the one that adds the foreground and background together). This should break the connection. Double click on the last foreground node to select it. Now add a Spill Suppression node. It's under 'Create' - 'Key' - 'Spill Suppression'. In the Inspector Panel for this node, set it to 'Basic' and set the spill color to 'Green'. The default for Amount (to remove) is set to 1.0. Connect the output of the Spill Suppression node back to the input of the last layer node.
There that looks better. Here's a look at our final node tree (also called a 'data flow'). My counter-matte was a bit 'thin' after inverting, so I added a curves node to darken the gray values to black. See if you can find it!
Not so complicated really. But this is a very basic look at Green screen compositing. For a much better final result, rotoscoping could be used to separate things like soft hair, transparent glass, quick moving (and blurred) arms and legs. Each of these would have their own matte settings. Also, the foreground and background should be color corrected to 'fit' better together, and the edges of the foreground should be treated to avoid the 'cut out' look of most Greenscreen shots. There are other methods to Despill the backing color (Green or Blue) from your foreground elements with less artifacts.
My final result - using a much more complicated data flow, can be found here:
Ramen Greenscreen Comp from Kurt Fillmore on Vimeo.
Where do you learn these advanced techniques? Again, I really recommend Steven Wright's book. Be sure to check Esteban Tovagliari's Blog for information on Ramen's development.
Ramen Blog