1 Your mission
fix the light rim without touching the matte or the gamma value
Look in the Grade’s Properties for the option that does unpremult → grade → premult inside the node
2 Why it works
Symptom: the green-screen robot has a thin light outline round its legs and shoulders, and a faint light band appears along the floor seam. Most people reach for an erode or a tighter matte. But view the a channel and compare the Premult node with the Grade: alpha is identical in every pixel, because this Grade doesn’t touch alpha. What changed is the colour.
This Grade raises the gamma so the robot looks as hazy as the plate. Gamma is not a pure multiply. On premultiplied colour an edge pixel, already multiplied by alpha, is treated as "a dark colour" and lifted far too much, so both the edges and the small leftover alpha along the floor seam light up.
on a premult edge: (c·a)^(1/γ) ≠ c^(1/γ)·aWhere the numbers come from: A case from a real production problem, retold without naming the job and rebuilt with our own Blender images. Computed in your browser: Merge, Grade, Premult, Keymix, Invert and Clamp are checked against node-based compositing software; Toe, Defocus, Sharpen, Grain, the Keyer and Despill are teaching versions, not identical to Nuke’s nodes.