- [Instructor] When compositing visual effects shotswe constantly need to isolate arbitrary objectsfor special processing operations like color correctionor a blur, so this chapter is about a million ways to key.The overarching strategy is to look at a target objectand ask yourself how is it different thanthe rest of the shot, then formulate a keying strategybased on that difference.Our first and most common keying techniqueis the ever-popular lumakey, which keys onthe brightness of an object.

While extremely useful, it has limitations and oftendoes not give good edge quality.If you'd like to review Nuke's lumakeyerin the Keyer node, you can find it in myNuke Essential Training course, Chapter 10, Keying.Here we'll see several techniques to increasethe quality of a lumakey and therefore its usefulnessto you and your compositing work.First up, don't over-adjust.Let me show you what I mean.When you're pulling a lumakey,you're pulling down on the blacks,let me switch my Viewer to the alpha channel,to clear them to solid black.

Well the problem isthe Keyer clips black and whites in the alpha channel,so I can overshoot,overshoot an keep going and keep going and never know it,and as I do, I am hardening my edges, making my keyworse and worse.Same thing for pulling up on the whites.OK, I can just keep overdoing it, and it never goesabove one, you can see down here my code valuefor the alpha channel is one here and zero there,no matter how hard I crank.

So you have no clue that you've overshot,and you're hardening up your key.So...what we do isput these back,we do some gamma-slamming, so that we can keepan eye on things.So let me re-hone the Viewer, and I'm going to setthe Viewer gamma to three, so I'm going togamma up the Viewer, and pull down on the blacks.Now as the blacks clear out, I can tellI want to get the blacks cleared just ever so gentlytill the last little particle of noise,in fact, I even leave in just a tiny bit of noise,that way I know I'm right on the cusp.

OK, Viewer gamma downto pull up on the whites.So we'll come up here and pull up on the whites.Now we don't want to overshoot, so let's put aRGB sampler there and watch my alpha channel right herewhile I gently approach 1.0,there, and stop.OK, restore normal Viewer gamma.So I have assured myself that I have not overshotand hardened the edges any more than I have to.

OK, let's go back to the RGB layer and cruise over hereto take a look at noise.Noise is in virtually all of our images, and it degradesthe quality of your lumakey.Let me show you right here.Let's pull a key on this guy, switching the Viewerto the alpha channel.Viewer gamma up.Blacks down.Here we are, and just until my noise almost disappears.

There we are.OK, Viewer gamma downto pull up on the whites.Again,RGB sample, watching my alpha values here very carefullyas I creep up on 1.0, and make sure I don't overshoot.And...Creeping,and creeping,and...There we are.OK, restoring Viewer gamma.So this is the best I could do with the noise in the pictureand I get this kind of chewy, noisy edgelike I would expect.

And of course when this footage is playing,this edge is going to sizzle.All right, no matter how good that sounds,you don't like sizzling edges.Let's go back to the RGB side and we'll take a look atthis De-noise node here to knock down the noise.All right, so let's try to key this one,so we'll open up our lumakey.Gamma up the Viewer.Pull down on our blacks after we switch the Viewer to alpha.

OK, just a tiniest bit of noise left.Viewer gamma down.Pull up on our whites.Got a sampler going so we can keep an eyeon our code values.Walking to 1.0 without crossing.There we go, 1.0.All right, let's put our Viewer back to normal.And now let's compare the two, let's push in.

So here's the original noisy one, and here is the de-noised,so you can see we got not only a lot more meatat the edge of our key, but it's also a lot smoother,and therefore less chatter.So cutting out the noise will help you to not have tochew into the key so much.In fact, look at the code values here.Here is the original one with the noise, I had topull this up to 245 to clear out the blacks.And here I only had to pull it up to .227,so I didn't have to crank so hard on those blacks.

Very good, better edges, better keys.All right, enough of noise.Now in the real world, let me set the Viewer back to RGBand hook into this guy, in the real worldthe background is not going to be uniform,it's going to have some kind of gradient to it,so let me gamma down the Viewer.You can see here, dark on the left, lighter on the right.In fact, over on the left, my code values are around .21,and over on the right, it's like .48.

So there's like a .27 difference in code valueacross the top, and we can see that with the Sampler node.Show you that right there.So the Sampler is wacking a line across hereand plotting the RGB values so you can actually seethe slope in that background.OK, so we'll put away our Sampler.So what are we going to do about that?We're going to apply a counter gradient in orderto even up the background.

But first let's pull a key on the originaland see what happens.So let me open up the Keyer.Again, Viewer gamma up.Blacks down,after I switch the Viewer to alpha channel.Down, down, down, and you can see my gradientis slowly wiping away,but I have to pull it really hard to clear thatlast bit out.Ooh, look at that .489.OK, Viewer gamma down.

Pull up on the whites.Again a sample box so I can watch my RGB,keep an eye on my alpha channel as I creep up to 1.0without blowing over.There we go.OK, restore Viewer gamma, and this is the key that I got.OK, got some nice, soft edges, it looks pretty good.Now let's return back to RGB view, re-hone the Viewer,and this ramp here is an exact counter gradientto the background, OK?You remember it got brighter to the right,so I made a ramp that got brighter to the right,and I'm going to subtract it.

So the original image minus this gradient will get methis flat background.So on the right I got about .21,on the left I have about .21.So now let's try to key this and see what happens.All right, so Viewer to alpha channel,and we'll set our Viewer gamma to three, gamma up.Blacks down.

I better hook my Viewer up to the Keyer, don't you think?Hehe.OK, I overshot, so here I am, now it's flat,it should be fairly, yeah, see, it's almost perfectly flat.OK, there you go, just a little bit left.OK, Viewer gamma down.Pull up on our whites.Now adding that gradient, that tilt to the picture,this is no longer flat, so I have to keep an eyeon the darker part here.

OK, you see the 1.0 is walking across, so I'm going toput a Sampler right on this edge, so I can make surethis guy goes to 1.0 and I don't overshoot.So let's creep up to that, watching our code valuesdown here, my alpha.And walking up, there we go.OK, reset my Viewer, restore the Viewer gamma.Now let's compare before and after.Before, and after, a huge difference.

Well now let's apply these ideas to a real-world case, OK?So Viewer back to RGB, let's look at a cloud.Now we've got film grain, and like every singlesky shot you'll ever work with, it has a gradientin the background.Skies will be darker at the top, lighter and lesssaturated at the bottom.So let's try pulling a key on the original sourceimage right here, OK?So I'm going to switch my Viewer to the alpha channel.

Gamma up.Blacks down, and I have to keep goinguntil I clear all the noise out of here.So let me inch my way up there,slowly and there, let's call that good.Viewer gamma back to normal.I'm not going to adjust the whites because our real pointis clearing out the blacks.OK, now let's take a look at the de-noised one here.Let's try to key that one.

So Viewer gamma up.Blacks down.Clearing, clearing.There we go.Restore Viewer gamma.And now let's compare the noisy oneto the clean one, and you can see we picked uplots of nice edge detail, and it's also not going to bebuzzy and chewywhile the clip is moving.Well that really helped, but wait, there's more.

Now let's take a look at what happens when we de-grain itand we level it with a counter gradient.So I measured the RGB values at the bottom and the top,figured out the difference, and I simply made a rampthat matched that gradient.Again, each RGB value had to be different, of course,because each channel is a different value,unlike the gray images we saw a minute ago.So if I take this image, and I add this gradient to it,it will even out the background like that.

See, now the code values up here and down thereare very similar.My backing region is now pretty darn flat,I'm ready for my lumakey.So let's pull a lumakey on this.Switch Viewer to alpha.Gamma-slamming up to three.Pulling down on our blacks to clear it out.There we are.Restore Viewer gamma.

Now let's compare the leveled onewith the de-grained one.Huge difference, look at all the extra detail I got.All over the place, detail everywhere on the leveled one.And then we compare to the original noisy one,and the difference is even more dramatic.OK.So, pre-processing a plate to sweeten it for a lumakeydramatically improves the quality of those keysand therefore the usefulness of lumakeying in your work.

However, that's just the beginning.In the next video, we'll see even more techniquesto make lumakeys even more useful to you.

Resume Transcript Auto-Scroll

Author

Released

10/3/2016

Blue-screen and green-screen keying is the bread and butter of visual effects compositing. Every VFX artist must master this complex subject to succeed in the industry. This course offers 12 hours of the most comprehensive and detailed training ever produced on the subject of keying, covering literally every aspect of the job. You can follow along with NUKE, the software featured in the videos, or with any other compositing software that offers floating-point math. NUKE master trainer Steve Wright introduces several overall compositing workflows, as well as a myriad of tips and tricks and several keying techniques never before published. Learn about green-screen, blue-screen, luma, and saturation keys; spill suppression; color correction; edge refinement; and more. Plus, get a bonus appendix chapter of tutorials on keyers such as KEYLIGHT, Primatte, Ultimatte, and others.