1 The idea
Erode shrinks the matte (negative) or grows it (positive). Leftover green edges disappear because they are cut out of the matte, not because their colour is fixed (that is despill’s job, K3). It eats hair and thin lines too, so it belongs at the end of edge fixing.
Suggested order: despill first, then adjust the alpha (gamma, covered in K5), then edge extend, then erode only if still needed.
2 Hands-on in the mini compositor
Last, and only a little
Where the numbers come from: Computed in your browser. Saturation, Multiply, Clamp, Invert, Keymix, Copy and Grade are checked against node-based compositing software. Blur, Defocus, Glow, Sharpen, ChromaticAberration, Vignette, LensDistort, Grain, Erode, Toe, the Keyer and Despill are teaching versions, not identical to Nuke’s nodes. Transform here is also a teaching version: bilinear filtering, no concatenation, cropped at the frame edge. Images are our own Blender renders (the green screen is fully code-built; the desert scene uses Gaea 2.3 hills, a Poly Haven CC0 HDRI sky, Poly Haven CC0 rocks and grass, Quixel sand and cliff textures and a Mixamo rig for the robot, with Quixel and Mixamo used in the renders only).