The tempting fix for a green screen that is "keyed but still green" is to push the key harder. A key and a despill answer two different questions about every pixel. The key decides how transparent the pixel is, and the despill decides what colour it keeps. If you only ask the first question, the edge stays green however good the alpha is. If you push the key to fix the colour, it starts eating hair instead.
The test card is synthetic, not real footage: 1280×720, a green screen at RGB(20,175,65), and ten patches including hair strands, a white shirt, light and dark skin, a yellow object and a grey veil at α=0.45. Because it was generated, the clean foreground and true alpha are known, which is the only reason anything here can be scored. The spill is not real light. It was added with a model that peaks at the outline and in semi-transparent areas, so every number here is about this card, on one Apple-silicon Mac, in one run. Colour error is ΔE76, and the new background is a cartoonish sky, grass and yellow stripe.
The key only decides transparency
On this card the green lives at the edges. Hair strands composited on grey come out at (82,115,86) against a true (90,82,77), ΔE 24.0. The veil's green sits about 41 above its red and blue. The white shirt is ΔE 16.6 in a 6-pixel edge band and 7.8 inside. Edges are exactly where alpha is fractional: a pixel at α=0.45 is part shirt and part screen, and the screen's share is still baked into its colour.
The key is a plain colour-difference matte, a = 1 − clip((G − max(R,B) − 20) / 70). The matte was decent, with mean absolute alpha error 0.019 over the frame and 0.192 in the edge band. The composite still had an edge-band ΔE of 23.1. More keying would not fix that, because the transparency was roughly right. The colour of those edge pixels still had the screen mixed in.
Despill is a separate second step
Adding one despill line after the key, the average limit G = min(G, (R+B)/2) on the foreground only, took the edge band from 23.1 to 13.2 and the whole frame from 5.41 to 3.58. Same matte, only the colour changed.
The opposite order shows it from the other side. With despill first, the screen itself got pressed to roughly (20,42,65), a dark blue-grey, and the key stopped seeing it as screen. Every alpha came out as 1, mean 1.000 against a true 0.330, the edge band jumped to ΔE 39.9, and the new grass was off by 80.7. Despill removes the colour the key is looking for, so it waits until the key is done.
Despill also has a price. The average limit took the yellow object's green from 205 to 143 and its hue from 49° to 30°, so yellow turned orange. A slower version that first subtracts the screen colour, F = (C − (1−α)·screen)/α, and then despills got the edge band to 11.7, the best of the five orders compared on this card. How the remaining 11.7 splits between the key and the formula was not separated in this test.
An AI matte leaves the colour alone too
For the AI side, the comparison used ImgIng https://imging.ai/ video matting (Beta) in a desktop Chromium browser on the same Mac, on a three-second real green-screen clip, exported as transparent WebM, the only format it offers once the background is transparent. That footage is public domain, published by VOA Learning English on Wikimedia Commons, and was trimmed and re-encoded for this. On frame 45 over grey, green-leaning pixels (G more than 10 above max(R,B)) were 2.7% at the hair tips and 4.9% on the hand with its lighter model, 7.7% and 14.8% with its quality model. After one average-limit pass, each of those four read 0.0%.
My reading, an inference, is that an AI matte usually produces alpha only and keeps the source colour, so the despill step still belongs after it. A plain chroma key on the same frame looked cleaner at 0.1% and 0.8%, but by thinning the hair: 14,748 semi-transparent pixels at the hair tips against 5,963 for the quality model, about 2.5 times as many. That is "push the key harder" again, paid for with the subject. The AI matte's error against true colour was not measured: the model doesn't treat the card's patches as a person, so the card can't stand in for it.
Top comments (0)