{"course":{"slug":"motion-and-audio","title":"Motion, Sound and Music","url":"https://addaly.com/learn/motion-and-audio","level":"intermediate","track":"create"},"lesson":{"slug":"despill-and-light-wrap","title":"Spill is real light, and light wrap is an honest fake","url":"https://addaly.com/learn/motion-and-audio/despill-and-light-wrap","position":32,"of":72,"minutes":10,"answer":"Green bounce lands on the subject where alpha is one, so the matte cannot remove it: despill clamps green to the average of red and blue and therefore desaturates anything genuinely green.","keyIdea":"Green bounce lands on the subject where alpha is one, so the matte cannot remove it: despill clamps green to the average of red and blue and therefore desaturates anything genuinely green, and light wrap replaces the missing interaction between subject and background by pushing a blurred copy of the background onto the edge band."},"body":{"format":"markdown","text":"## The subject is green and the key is not the reason\n\nYou have a clean matte. The edges are soft in the right places, the core is solid, and the composite still looks wrong: the actor's shoulder has a green rim, their hair has a green tint through it, and the whole figure sits on the new background like a sticker.\n\nNeither problem is a matte problem. The first is spill, the second is the absence of interaction between foreground and background. They are fixed after the key, and they are most of what separates a composite that reads as real from one that does not.\n\n## Spill is real light, and it is on the subject\n\nA green screen is a large green surface with light bouncing off it. That light lands on your subject. It is not an artefact of keying; it is a physically correct green bounce, and it would be there if you photographed the scene on film with no digital process at all.\n\nThe matte cannot remove it, because the matte only decides *whether* a pixel shows, not *what colour* it is. The green rim is inside the subject, where alpha is 1.\n\n**The standard despill algorithm** is one line, and knowing it tells you what it will do to your image:\n\n```\nif green > (red + blue) / 2:\n    green = (red + blue) / 2\n```\n\nWherever green exceeds the average of the other two channels, clamp it down to that average. Variants use `max(red, blue)` instead, which is gentler, or a weighted mix, which lets you dial the aggressiveness.\n\nThe consequence is immediate and worth anticipating: **despill desaturates**. Removing green from a pixel that was greenish (a khaki jacket, a green-tinted highlight in blonde hair) leaves it grey. This is the standard complaint after despilling, and there is no algorithm that distinguishes \"green light from the screen\" from \"a green object\", because in the image they are the same photons.\n\nThe professional workaround is to restore some colour afterwards: take the luminance of the despilled area and tint it with a colour sampled from the new environment. Nuke, Fusion and Blender all let you build this; it is a hue-shift rather than a recovery, and it is honest about being one.\n\n## Blue screens, and when to choose one\n\nGreen is standard because sensors have twice as many green photosites in the Bayer pattern, so the green channel has the best signal-to-noise and the finest detail, which is what a keyer needs.\n\nBlue is better when the subject is green, when there is a lot of skin in frame (skin has significant red and green and very little blue, so blue spill contaminates it less), or when the scene is lit low and warm and a green bounce would be obviously wrong. The despill arithmetic is identical with the channels swapped.\n\n## Light wrap: the cue nobody names\n\nA subject in a real environment is lit by that environment. Bright areas behind a person spill light around their silhouette: this is partly physical light wrapping around the edge, partly lens flare inside the camera, partly the softness of any real edge. A composite with a perfectly clean edge has none of it, and the eye reads \"cut out\" without being able to say why.\n\nLight wrap is the fix, built in four steps:\n\n1. Take the **background** you are compositing onto.\n2. **Blur** it substantially: 10 to 40 pixels depending on the frame size.\n3. Restrict it to the **edge band** of the matte: multiply by the matte's edge, typically the matte minus an eroded copy of itself.\n4. **Screen or add** that onto the foreground.\n\nThe result is that a bright window behind the subject now throws a faint bloom onto their shoulder, in the correct colour, at the correct place. It costs five nodes and it is the single highest-return step in a green-screen composite after despill.\n\nKeep it subtle. Light wrap is heavily over-applied by people who have just discovered it; if you can point at it, it is too strong.\n\n## Edge treatment, in order\n\nThe sequence that solves most edges, applied only in the edge band:\n\n- **Despill first.** Everything afterwards works better on clean colour.\n- **Erode or dilate the matte by a fraction of a pixel.** Usually eroding by 0.3 to 1 pixel removes the last of the old background. Whole-pixel erosion eats detail.\n- **Blur the matte very slightly** to reintroduce softness lost by eroding.\n- **Light wrap.**\n- **Match the grain**, covered in its own lesson, because a clean edge on a grainy plate is visible even when everything else is right.\n\n## What cannot be fixed here\n\nIf the screen was lit unevenly, or the subject stood too close to it, or the footage is heavily compressed with 4:2:0 chroma subsampling, the colour information at the edges is already gone. Despill and light wrap operate on what is in the file; they do not recover what the codec discarded.\n\nThis is the connection back to the shoot: chroma subsampling stores colour at a quarter of the luminance resolution, so a 4:2:0 file has colour edges that are literally two pixels wide where the luminance edge is one. Every edge tool in this lesson is then working on smeared data. It is the concrete reason 4:2:2 or better is specified for green-screen work, and the reason a phone's default recording is a poor source for it.\n\n## The free path\n\n**Blender**'s compositor has a `Despill` option inside its keying nodes and the node set to build light wrap by hand: blur, matte erode, mix. **Fusion** in the free DaVinci Resolve has dedicated despill controls and a `MatteControl` node with erode, dilate and blur in one place. **Natron** ships Keyer and despill nodes. All free.\n\n## The limitation\n\nDespill is destructive and approximate. It cannot tell a green object from green light, it desaturates whatever it touches, and every implementation is a heuristic rather than a physical inversion. There is no correct answer: only a choice about which error is less visible in this shot.\n\nLight wrap is an even franker fake: it is not a simulation of anything, just a blurred copy of the background pushed onto the edge because the result looks right. Both are craft rather than science, which is why two compositors will produce different and equally defensible results from the same plate."},"check":{"question":"After despilling, a subject's khaki jacket has turned grey. What is the underlying reason, and what is the realistic remedy?","options":[{"text":"The despill was applied before the matte was finished, so it operated on background pixels as well; re-order the operations and the jacket is preserved.","correct":false,"tempting":"Despill order affects edges, not a solidly keyed interior region, and a grey jacket would persist after re-ordering."},{"text":"The keyer has included part of the jacket in the key, so the jacket is partially transparent and mixing with a neutral background; tighten the key on that colour range.","correct":false,"tempting":"Would produce transparency rather than desaturation, and the jacket would show the background through it."},{"text":"In the image, green light from the screen and a green object are the same photons, so the clamp cannot distinguish them; restore the hue afterwards by tinting the despilled luminance.","correct":true},{"text":"The despill algorithm clamps green to the average of red and blue, which is mathematically only correct when red and blue are equal, so any subject lit with a colour cast will lose saturation in proportion to how far apart the red and blue channels are in the original plate.","correct":false,"tempting":"Reasons about the formula's behaviour under a colour cast rather than about the real cause, which is that the operation cannot tell green light from a green object."}]},"prev":{"slug":"the-shoot-decides-the-key","title":"A green screen is fixed on set, not in the edit","url":"https://addaly.com/learn/motion-and-audio/the-shoot-decides-the-key"},"next":{"slug":"rotoscoping","title":"Drawing the matte by hand","url":"https://addaly.com/learn/motion-and-audio/rotoscoping"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Spill is real light, and light wrap is an honest fake', in Motion, Sound and Music. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/motion-and-audio/despill-and-light-wrap (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Spill is real light, and light wrap is an honest fake","courseTitle":"Motion, Sound and Music","module":{"index":4,"slug":"putting-two-images-together","title":"Putting two images together"},"answer":null,"keyIdea":"Green bounce lands on the subject where alpha is one, so the matte cannot remove it: despill clamps green to the average of red and blue and therefore desaturates anything genuinely green, and light wrap replaces the missing interaction between subject and background by pushing a blurred copy of the background onto the edge band.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"the-subject-is-green-and-the-key-is-not-the-reason","runs":[{"text":"The subject is green and the key is not the reason"}]},{"t":"p","runs":[{"text":"You have a clean matte. The edges are soft in the right places, the core is solid, and the composite still looks wrong: the actor’s shoulder has a green rim, their hair has a green tint through it, and the whole figure sits on the new background like a sticker."}]},{"t":"p","runs":[{"text":"Neither problem is a matte problem. The first is spill, the second is the absence of interaction between foreground and background. They are fixed after the key, and they are most of what separates a composite that reads as real from one that does not."}]},{"t":"h2","id":"spill-is-real-light-and-it-is-on-the-subject","runs":[{"text":"Spill is real light, and it is on the subject"}]},{"t":"p","runs":[{"text":"A green screen is a large green surface with light bouncing off it. That light lands on your subject. It is not an artefact of keying; it is a physically correct green bounce, and it would be there if you photographed the scene on film with no digital process at all."}]},{"t":"p","runs":[{"text":"The matte cannot remove it, because the matte only decides "},{"text":"whether","i":true},{"text":" a pixel shows, not "},{"text":"what colour","i":true},{"text":" it is. The green rim is inside the subject, where alpha is 1."}]},{"t":"p","runs":[{"text":"The standard despill algorithm","b":true},{"text":" is one line, and knowing it tells you what it will do to your image:"}]},{"t":"code","lang":"","label":"Text","text":"if green > (red + blue) / 2:\n    green = (red + blue) / 2"},{"t":"p","runs":[{"text":"Wherever green exceeds the average of the other two channels, clamp it down to that average. Variants use "},{"text":"max(red, blue)","code":true},{"text":" instead, which is gentler, or a weighted mix, which lets you dial the aggressiveness."}]},{"t":"p","runs":[{"text":"The consequence is immediate and worth anticipating: "},{"text":"despill desaturates","b":true},{"text":". Removing green from a pixel that was greenish (a khaki jacket, a green-tinted highlight in blonde hair) leaves it grey. This is the standard complaint after despilling, and there is no algorithm that distinguishes “green light from the screen” from “a green object”, because in the image they are the same photons."}]},{"t":"p","runs":[{"text":"The professional workaround is to restore some colour afterwards: take the luminance of the despilled area and tint it with a colour sampled from the new environment. Nuke, Fusion and Blender all let you build this; it is a hue-shift rather than a recovery, and it is honest about being one."}]},{"t":"h2","id":"blue-screens-and-when-to-choose-one","runs":[{"text":"Blue screens, and when to choose one"}]},{"t":"p","runs":[{"text":"Green is standard because sensors have twice as many green photosites in the Bayer pattern, so the green channel has the best signal-to-noise and the finest detail, which is what a keyer needs."}]},{"t":"p","runs":[{"text":"Blue is better when the subject is green, when there is a lot of skin in frame (skin has significant red and green and very little blue, so blue spill contaminates it less), or when the scene is lit low and warm and a green bounce would be obviously wrong. The despill arithmetic is identical with the channels swapped."}]},{"t":"h2","id":"light-wrap-the-cue-nobody-names","runs":[{"text":"Light wrap: the cue nobody names"}]},{"t":"p","runs":[{"text":"A subject in a real environment is lit by that environment. Bright areas behind a person spill light around their silhouette: this is partly physical light wrapping around the edge, partly lens flare inside the camera, partly the softness of any real edge. A composite with a perfectly clean edge has none of it, and the eye reads “cut out” without being able to say why."}]},{"t":"p","runs":[{"text":"Light wrap is the fix, built in four steps:"}]},{"t":"ol","start":1,"items":[[{"text":"Take the "},{"text":"background","b":true},{"text":" you are compositing onto."}],[{"text":"Blur","b":true},{"text":" it substantially: 10 to 40 pixels depending on the frame size."}],[{"text":"Restrict it to the "},{"text":"edge band","b":true},{"text":" of the matte: multiply by the matte’s edge, typically the matte minus an eroded copy of itself."}],[{"text":"Screen or add","b":true},{"text":" that onto the foreground."}]]},{"t":"p","runs":[{"text":"The result is that a bright window behind the subject now throws a faint bloom onto their shoulder, in the correct colour, at the correct place. It costs five nodes and it is the single highest-return step in a green-screen composite after despill."}]},{"t":"p","runs":[{"text":"Keep it subtle. Light wrap is heavily over-applied by people who have just discovered it; if you can point at it, it is too strong."}]},{"t":"h2","id":"edge-treatment-in-order","runs":[{"text":"Edge treatment, in order"}]},{"t":"p","runs":[{"text":"The sequence that solves most edges, applied only in the edge band:"}]},{"t":"ul","items":[[{"text":"Despill first.","b":true},{"text":" Everything afterwards works better on clean colour."}],[{"text":"Erode or dilate the matte by a fraction of a pixel.","b":true},{"text":" Usually eroding by 0.3 to 1 pixel removes the last of the old background. Whole-pixel erosion eats detail."}],[{"text":"Blur the matte very slightly","b":true},{"text":" to reintroduce softness lost by eroding."}],[{"text":"Light wrap.","b":true}],[{"text":"Match the grain","b":true},{"text":", covered in its own lesson, because a clean edge on a grainy plate is visible even when everything else is right."}]]},{"t":"h2","id":"what-cannot-be-fixed-here","runs":[{"text":"What cannot be fixed here"}]},{"t":"p","runs":[{"text":"If the screen was lit unevenly, or the subject stood too close to it, or the footage is heavily compressed with 4:2:0 chroma subsampling, the colour information at the edges is already gone. Despill and light wrap operate on what is in the file; they do not recover what the codec discarded."}]},{"t":"p","runs":[{"text":"This is the connection back to the shoot: chroma subsampling stores colour at a quarter of the luminance resolution, so a 4:2:0 file has colour edges that are literally two pixels wide where the luminance edge is one. Every edge tool in this lesson is then working on smeared data. It is the concrete reason 4:2:2 or better is specified for green-screen work, and the reason a phone’s default recording is a poor source for it."}]},{"t":"h2","id":"the-free-path","runs":[{"text":"The free path"}],"role":"free"},{"t":"p","runs":[{"text":"Blender","b":true},{"text":"’s compositor has a "},{"text":"Despill","code":true},{"text":" option inside its keying nodes and the node set to build light wrap by hand: blur, matte erode, mix. "},{"text":"Fusion","b":true},{"text":" in the free DaVinci Resolve has dedicated despill controls and a "},{"text":"MatteControl","code":true},{"text":" node with erode, dilate and blur in one place. "},{"text":"Natron","b":true},{"text":" ships Keyer and despill nodes. All free."}]},{"t":"h2","id":"the-limitation","runs":[{"text":"The limitation"}],"role":"limit"},{"t":"p","runs":[{"text":"Despill is destructive and approximate. It cannot tell a green object from green light, it desaturates whatever it touches, and every implementation is a heuristic rather than a physical inversion. There is no correct answer: only a choice about which error is less visible in this shot."}]},{"t":"p","runs":[{"text":"Light wrap is an even franker fake: it is not a simulation of anything, just a blurred copy of the background pushed onto the edge because the result looks right. Both are craft rather than science, which is why two compositors will produce different and equally defensible results from the same plate."}]}],"check":{"question":[{"text":"After despilling, a subject’s khaki jacket has turned grey. What is the underlying reason, and what is the realistic remedy?"}],"options":[{"text":[{"text":"The despill was applied before the matte was finished, so it operated on background pixels as well; re-order the operations and the jacket is preserved."}],"correct":false,"tempting":[{"text":"Despill order affects edges, not a solidly keyed interior region, and a grey jacket would persist after re-ordering."}]},{"text":[{"text":"The keyer has included part of the jacket in the key, so the jacket is partially transparent and mixing with a neutral background; tighten the key on that colour range."}],"correct":false,"tempting":[{"text":"Would produce transparency rather than desaturation, and the jacket would show the background through it."}]},{"text":[{"text":"In the image, green light from the screen and a green object are the same photons, so the clamp cannot distinguish them; restore the hue afterwards by tinting the despilled luminance."}],"correct":true,"tempting":null},{"text":[{"text":"The despill algorithm clamps green to the average of red and blue, which is mathematically only correct when red and blue are equal, so any subject lit with a colour cast will lose saturation in proportion to how far apart the red and blue channels are in the original plate."}],"correct":false,"tempting":[{"text":"Reasons about the formula’s behaviour under a colour cast rather than about the real cause, which is that the operation cannot tell green light from a green object."}]}],"order":[1,3,2,0],"why":null},"prev":{"slug":"the-shoot-decides-the-key","title":"A green screen is fixed on set, not in the edit","minutes":10},"next":{"slug":"rotoscoping","title":"Drawing the matte by hand","minutes":10}}}