GET STUCK INTO THIS!
A problem you haven't met yet, but will
Maybe you haven't shot a green screen scene yet, or you haven’t opened Blender and learned how to do a 3D render. But when you do, and you nail the lighting, get a clean key, composite one thing on top of another, at some point you’re going to hit an ugly line around the edge of the thing you’re compositing.
Most people just start attacking that border, trying to get the colour to match, or finding ways to shave it off. Not you though - you’re going to remember this moment, and revisit this concept, and solve the problem correctly.
GODDAMN MATHS
In a computer, colour is numbers. You can’t escape it, so you may as well make peace with it. To help you reach your zen state, take a look at this cheat sheet explainer if you haven’t already!
Any footage with transparency (a green screen key, a VFX render, anything with an alpha channel) has already had a bit of maths done to it behind the scenes. It's called premultiplication, and it's completely normal. The colour is multiplied with the alpha. Where the alpha is 0 (i.e. transparent), the colour gets multiplied by zero, going to black. Where the alpha is 1 (i.e. solid), the colour is multiplied by 1, meaning it doesn’t change.
That’s all good. The problem is at the edges, where the semi transparent pixels are. The alpha will be between 0 and 1, meaning that the colour will be multiplied by a fraction. What happens if you do that? The edge colour changes - because colour is a number and if the number gets smaller, it gets closer to 0, which means closer to black.
If you then colour correct that, you’re correcting a colour that’s technically wrong, and that’s why beginner comp artists get horrible edges.
The Fix
The fix is simple once you know the order of operations: undo the premultiplication, colour correct, then redo it. It's called the divide/grade/multiply sandwich, and it takes seconds once you know where to click.
This cheat sheet will show you exactly what the problem is, and help you understand the maths behind it.
