Chroma Key
How It Actually Works
Green Screen Isn't Magic
One of my mantras when teaching VFX has always been "Green screen isn't magic". That's important, because there's this feeling in the zeitgeist of "well if you make a thing green, then the computer puts in CGI". Which in an AI world is now technically true BUT that's not chroma keying.
Chroma keying is just a simple principle. In an additive system of colour (i.e light rather than pigment, which is how computers work with colour), you have 3 primaries - red, green, and blue. Computer images are stored as 3 separate channels, dedicated to these three primaries. So (1,0,0) is full red, zero green, zero blue. Pure, unadulturated redness. (0,1,0) and (0,01) are green and blue. Any other colours are created by mixing (1,1,0) is full red and full green, which in additive mixing gives you yellow.
Of course, in the real world, nothing is a pure colour, it's always a mix. But imagine if you COULD get a pure colour. Because that colour has its own channel in the image, you could just throw away everything in that channel.
That's basically chroma keying. You're aiming to get a pure primary colour, so that you can control it through its channel. Normally that control will be creating a mask so you that you can remove the colour, but keying isn't just about removal. Once you've "grabbed" that colour, you can do whatever you want with it - change it to another colour, use it to generate clouds, whatever.
So on set, setting up chroma screens is about getting a pure colour. The more mixed the colour is, the more difficult it is to isolate, because it's spread over several channels, and that colour is likely to appear in lots of places, which pure colours don't.
So here's the key principles of keying, with only a tiny bit of magic (abracadabra. There.)
Which Colour, And Why
Green or blue screen? Well...don't use a green screen in a forest, or a blue screen in an aquarium. It's not rocket science. Green is the default, for technical reasons (camera sensors carry more green information. There's a bias in digital photography towards green, as the human eye is naturally more sensitive to it).
Welll, almost never red, because human skin carries a lot of red regardless of race, but there's times when it would be useful (maybe if I was chroma keying a tropical green and blue frog, for example)
What A Screen Has To Be
Small, wrinkled, poorly lit screens are going to damage your key. A screen that looks fine to your eye will often fall apart under a key. Flat, bright, evenly lit green is always worth the extra setup time, if you can.
Three Things, In Order
When you pull a key you aren't actually removing the colour. It's still there, but you are generating a matte: a black and white image where white means keep and black means remove. Grey means partly transparent, which is exactly what you want on hair and glass and exactly what you don't want anywhere else.
Pulling a key is a delicate art, and in reality it often looks like doing separate keys for separate areas (for example, one pass for where your green screen is in shadow, and one for the light). Then you combine those masks, and use those masks to "chop out" the green (but again, IT'S STILL THERE. In the green channel. But the mask will be in your alpha, which will mean "don't show it, even though you're actually there)
You're only interested in your key IN THE AREA WHERE IT COMES IN CONTACT WITH YOUR ACTOR/FOREGROUND ELEMENT. Everything else can be masked off, and doesn't need a key
Removing the green background does not remove the effect of the green background. The screen is a giant bounce card. That light lands on hair, ears, shoulders and any bright fabric, and it is still there after a perfect key.
Without a trained eye, you won't spot it while the screen is there, because the green of the screen is much more overpowering than the spill. But as soon as that screen goes, it'll blow your mind how much green there is everywhere else, especially if it was shot on a fully green stage!
If you can, keep your green far away from your set and actors. That's easier said than done, because the further back it is, the bigger it needs to be to be useful, and space is often an issue at an indie level. So failing that, just get good at handling the spill. It's not that hard. You basically need to hoover away the green, which is technically removing light, so then if you're slick, you'll replace that with a different light colour
Edges will make you lose your mind quickly when it comes to keying. The problem is that it's impossible to have pure colour on them. The best camera and the sharpest lens in the world will never have a perfect 1 pixel edge, there's always so softness. That soft area is a mix of the green screen behind and the foreground element in front.
And because none of this is magic, there's no way to magically pull out the green, because even though your eye will TELL you its green, if you colour pick it it's not that green. So then you get really aggressive with your keyer, and just hack into the edge. Well now you've removed all the green, but you've got an unrealistic 1 pixel edge on there.
Hair, motion blur, semi-transparent stuff. These are all a huge pain in the arse.
Before you get pulled in spending hours correcting them, watch your shot back and decide if you care. You should only put in time where it will make a difference (unless you have a supervisor and they're insisting on perfection. In which case...hey it's practice, and you'll get really good at it)
