![]() |
||||
|
|
||||
Building a keyer in Shake (shake)
[ Contribute A Tip ] [ Tips and Tricks Home ]
Tahl Niran explains how to make your own keyer in Shake. Added: February 20th 2005 Submitter: Mike Seymour Score: ![]() ![]() ![]() ![]() ![]() Hits: 20503
In this tip we'll build a keyer from basic shake building blocks or nodes. This not designed as a tutorial about how to get perfect keys or better integration of your bluescreen/greenscreen elements, but it will help you in understanding how keyers work. Shake ships with two awesome plug-in keyers (and one perhaps dubious default chroma key) - but knowing the fundamentals can often make you a better compositor. Hence, I thought I would show you how to make a keyer complete with a spill suppressor, entirely from scratch. Two quick notes before we begin: * The principles of this tutorial are base on a dv garage tut by Alex Lindsey in which he shows how to make a colour difference keyer in After Effects, and how to construct a simple spill suppressor. dvgarage.com is an excellent site and we would recommend spending some time there. * Also I would recommend that before keying any shot you go through and do a real basic roto which isolates your talent from the extraneous portions of your blue/green screen. This will help cut down on potential problems caused by irregularities in the screen. ![]() The Footage:
This was shot on Digital Betacam and then captured through flame. I have gone through and deinterlaced the footage, stabilized it and scaled it to 75% of its original size. Then I rendered it as a QuickTime with some compression. But the good news is it still keys reasonably well. Normally I would never try to key something without having a background plate - since matching the foreground to the background is the key to any good composite, but for our purposes today we’ll make an exception. ![]() The Keyer You wont believe how simple this technique is. We are going to be using the inverse of the blue channel of our image combined with red channel of our image to make a matte. Basically the inversed blue will do most of the work and the red channel will pick up some of the stubborn areas. 1. Add a FileIN and load the clip fam19_bs.mov. You can dowload the the shake script here. NB: I jumped to frame 15 of the sequence. A wise compositor once told me that it was always bets to pull your key at the hardest or least desirable frame in the sequence. Here the woman on shot left has some nasty motion blur on her hand so I am guessing this is a good place to start. Remember that motion blurred areas should be partially transparent. As you work try not to loose all the detail in this area. After you complete this tutorial you should probably go back cut a rough matte for these problem areas and re-key them separately, you can then recombine them with the larger key before the switchMatte node
![]() 2. Now make a color=> reorder node. Set its channels to ‘rrrn’ ( red, red, red, none). Rename this node rrr_reorder for future reference. 3. Branch another reorder node from the fam19_bs node and set this ones channels to bbbn (blue, blue,blue,none ). Rename this node bbbn_reorder.
4. Now select rrr_reorder and create a color=>expand node. Name this redChannel_expand.
We are going to use these expand nodes to clamp the luminance of their respective inputs. You can just do this by eye. ![]() 6. Open the “ ” next to ‘Low Colour’ and ‘High Colour’ and select the ‘l’ button for luminance, you can now use the slider. Conversely you can hold down the ‘l’ key while dragging over the colour pot for luminance or the ‘o’ key for overall Basically you are just going to increase the low colour and decrease the high colour to act as a clamp on these values. For the blue reorder you want to clamp the values such that the screen in the back ground goes black and our talent in the fg becomes white. Try to retain detail on the edges of the talent while getting rid of black regions on the talent. ![]() Here are some values I prepared earlier : inv_blueChannel_reorder :
![]() You might notice some stubbornness around the woman’s shoulder :
![]() Don’t panic too much about this now we will fix this up using the red channel. 7. Using the same technique as in the previous step, clamp the red channel up so that only the areas which were stubborn or previously full of black patches are now white. ![]() Here are my values (feel free to tweak till you’re happy with the results )
![]() 8. Next create a layer=> screen node and put redChannel expand in the foreground input and inv_blueChannel_expand in the background input 9. Finally place another color=>expand node under this screen and rename this overall_expand. This node can be used as a bit of a fine tuner for semi-transparent areas and the like
![]() The result will be your matte. 10. Create a layer=> switchMatte node and put fam19_bs into the foreground input and overall_expand into the background input. Set the matte channel to either r,g or b and set matteMult to 1 / on.
![]() If we look at the result we can see we have a basic key, except there is a lot of blue spill and some edge problems: ![]() Spill Supressor: There are lots of ways to spill suppress. Some keyers have the function built in there are free macros and there is the spillSupress node (ugh!). To be honest my preferred method is to use the hueCurves node but I will cover in a later tutorial ! We are going to make our own spill suppressor with just a few reorders and a couple of transfer modes. Because our footage is blue screen and because we will, in theory, be compositing it onto a medium luminance background, we need to construct a suppressor that will give medium edges without the tell-tale blue chrominance. To do this we will be using the brightness of the background of the green channel to replace the brightness values of the same area in our red and blue channels. We will be turning our screen to medium grey. If we look at our green channel the screen is medium grey. So we must make the screen in all these channels the same medium grey. We do this by replacing the dark grey pixels of our red background and the bright blue pixels with the medium grey ones from our green channel; resulting in the same colour value for all the channels and hence ‘medium grey’ There is an easy way to do this. The min and max nodes, as the name suggest allow us to layer based on the maximum or minimum value of pixels in an image. Confused? Good let’s proceed then. 11. Create a color=>reorder node. Rename it rrrn_reorder and set its channels to ‘rrrn’ 12. Create a color=>reorder node. Rename it bbbn_reorder and set its channels to ‘bbbn’ 13. Create a color=>reorder node. Rename it gggn_reorder and set its channels to ‘rrrn’ 14. connect fam19_bs to each of these nodes. 15. select gggn_reorder and branch create a layer=>max node 16. repeat last step but now branch create a layer=>min node 17. place bbbn_reorder in the background input of min1 and rrrn_reorder in the background input of max1.
![]() 18. select fam19_bs and brach creat another reorder node set its channels to ‘ngnn’ (none,green,none,none) 19. select max1 and create a reorder node and set its channels to ‘rnnn’ 20. select min and make yet another reorder node set its channels to ‘nbnn’ ![]() The reason for this last step was to create three branches the one on the left has our new red channel, the one in the middle has our original green channel and the one on the right has a new blue channel. We will need to recombine these to get our final rgb image. Which we can now do will do this using the add function. 21. Select rnnn_reorder and creat a layer=> iAdd. Place ngnn_reorder into the background input. 22. Select the iAdd node and create another iAdd and put nbnn_reorder into the background input.
![]() if we look at our resulting image we have a nicely de-saturated background and our talent has come out of the reordering and layering relatively unharmed. ![]() Putting it together : All that remains now is to multiply the colour suppressed image with the matte. 23. Select the final iAdd node, the one you just made in step 22 and place it into the input of the switchMatte node you made in step 10. ![]() 24. Create a colour node and set its r,g and b values to 0.5. Now select switchMatte and create a layer over node. Connect the colour node to the background input of this over node. ![]() CONCLUSION: ![]() If we look at the results we see that there are still a few problems with the edges of the key. Also the woman’s hand at the left of shot is less than ideal. As previously stated you will probably have to go back and make a separate keyer for this portion of the image then recombine this with our larger key. I would encourage you to think of keying as more than just a one step process. You will generally have to make multiple keys and then combine them to produce the matte. In production this is almost always the case. For example in this shot I keyed the girl on the right separate to the other two actors and then went through and made separate keys for the motion blurred hands and some other fix-up’s to get more detail in the hair. Making multiple keys work together and Edge treatments will be covered in a later tutorial.
|
|