Background removal eats hair and glass edges
Hard alpha thresholds chew through hair, glass and motion blur. Use a matting pass, generate for cleaner edges, and repair the matte instead of rekeying.
A cutout looks fake at the edge, not in the middle. Hair becomes a helmet. Spectacle frames grow a dark crust. A wine glass turns into a bottle-shaped hole. The subject was fine. The alpha was a decision: this pixel is in, that pixel is out.
That decision is the defect. A usable matte is grey at the boundary. Semi-transparent pixels are how flyaway hair, motion blur, glass, and the thin rim of a shoulder composite into a new backdrop without a fringe. A hard threshold throws those pixels away, or assigns them fully to the subject, which is how you get the cardboard cutout.
Stop asking a binary key to do a matting job. Generate contrast the matte can hold, then repair a bad matte instead of re-running at a harsher setting.
Why hard alpha destroys the edge
Background removal produces a matte: a per-pixel record of how much of each pixel belongs to the subject. Hair against a wall is not a cartoon outline. A single pixel can be part strand and part plaster. Glass is worse, because the "subject" includes refraction of whatever was behind it. Motion blur is a smear of both.
A hard threshold says: above this amount, 100% subject; below it, 0%. Every in-between pixel is forced. The lost strand is the halo. The kept plaster is the colour spill from the old room, now sitting on your new background.
On video the same threshold has to agree across time. A matte a pixel wider on frame twelve than on frame eleven crawls, which gives away a machine cutout more reliably than any still. Segmentation is the stencil underneath; an early hard decision poisons later frames that inherit it.
Versely has two video paths, and they fail at the edge for different reasons.
The colorkey path, remove a video background, is a deterministic FFmpeg key. It only works on a solid pure-black or near-black backdrop. key_similarity and key_blend are the threshold and the softness. Crank similarity to "get a cleaner key" and you eat the semi-transparent edge. That path will not key green, blue, white, or a real room; for those you want the model path.
The model path (remove_background) is the AI cutout: pass the clip, pick a model such as BRIO Video Background Removal or VEED Video Background Removal. It will attempt hair. It will still snap toward a binary matte on glass, smoke, mesh, and blur, because those are the cases where "how much of this pixel is the subject" does not have a clean answer.
Photos are a third pipeline. There is no dedicated one-click eraser. Removing a background from a photo is a prompt-driven edit through generate_image_from_image. Instruction editors regenerate. They can chew the edge and quietly restyle the subject. Inspect hair and glass at 100% before you composite. A pretty preview against white is not a matte check.
Generate so the matte has something to hold
Most bad edges are decided at generation, not at keying. Contrast between subject and background is what the matte is made from. Resolution will not save a dark coat on a dark wall.
If you control the source, give the removal a job it can do:
- Plain, even, slightly lighter (or slightly darker) backdrop. "On a plain light-grey sweep, even studio light, no environment bounce" is a useful generation prompt. Busy rooms are for plates you do not intend to cut out.
- Separate the hard cases. Do not ask one generation to hold flyaway hair, a wine glass, and a smoke wisp against a window. Generate the subject clean; add glass highlights or smoke as their own pass, or shoot/generate them already on the destination colour so refraction stays plausible.
- Avoid motion blur on a clip you plan to key. A locked-off, "static, tripod" camera move is a matte instruction as much as a camera instruction. Fast handheld plus removal is how you get a crawling fringe.
- For talking-head UGC, a clean wall behind the speaker beats a bookshelf. Isolation-and-composite flows still inherit whatever edge the source gave them.
If the source already exists and the contrast is poor, you will not key your way out. Either relight / regenerate, or keep the original background and composite only where the silhouette is honest.
Glass-specific: the interior of a bottle is the old background, warped. Removing the room leaves the model to invent what the liquid "should" have shown. Either keep a plate close in colour to the final composite so the refraction still reads, or accept that a transparent product on a replacement scene needs a manual interior, not a key.
When to reach for a matting pass
A matting pass is any step whose job is a soft alpha, not a yes/no. You need one when the destination background is a different brightness or hue from the source, and the subject has any of: hair, fur, fabric fringe, glasses, bottles, steam, motion blur.
Three practical forks:
1. Soften the key you already have. On the black-backdrop colorkey, back off key_similarity and raise key_blend until the edge is slightly too generous, then choke it in the compositor with a 1px erode and a small blur. A slightly dirty edge you can refine is better than a clean helmet. On an AI cutout, do not re-run at a "more aggressive" setting. Take the matte you got and treat it as a first pass.
2. Key downstream from a green plate. VEED Video Background Removal Green Screen replaces the background with solid chroma green rather than a finished cutout. That is a matting handoff: you get a plate a real keyer can work, with softness, spill suppression, and a garbage matte, instead of a baked binary alpha. Use it when the composite is the product and you already have a keyer you trust.
3. Do not key at all. If the edge is hair-in-wind, eyeglasses with a window in them, or smoke, a physical green screen still wins, because a green screen is a measurement. The AI path is a guess. For a hero commercial with long hair against a moving plate, guess last. For a talking-head variant on a colour wash, guess first and repair.
If the edge is almost right on every frame and different every frame, a 1px feather calms crawl more cheaply than a new generation. Watch at full speed; scrubbing hides it.
Repair a bad matte; do not harden it
You already have a cutout that is almost right. The next move is local, not another threshold.
Inspect correctly first. Composite over the destination background, and also over a violently contrasting solid (hot pink, or a checkerboard). Checking against white hides the dark fringe; checking against black hides the light one. Both will show up on a real plate.
Then repair, in this order:
- Choke and feather. A 1px erode plus a 0.5–1px blur fixes a lot of helmet hair and sparkle. If that eats eyelashes or spectacle rims, you went too far; dilate a hair instead and despill.
- Holdout the interior. On glass, force the interior alpha to stay partial rather than punching a hole. A simple shape mask over the bowl of the glass, set to 30–60% rather than 0 or 100, is often enough for a social composite.
- Replace the fringe colour. Residual edge pixels carry the old room. A slight despill toward the new backdrop (or a 1px inward clone of the subject's own edge colour) reads as "belongs" more than a perfect geometric edge.
- Inpaint the failure, not the person. For a clump of hair that became a block, mask that clump with a feather and run a local inpaint against the new background, rather than re-removing the whole frame. Same for a ruined rim of a glass.
- Regenerate the source only when the silhouette is the problem (subject and backdrop share a tone, or the hair was never resolved). A better matte cannot be pulled from a source that never contained the edge.
Keep the cutout in a format that actually carries alpha. H.264 MP4 will bake it onto black and the removal is undone. If you are leaving Versely for a compositor, that handoff format matters more than which model produced the matte.
Tell the agent the backdrop colour honestly when you ask it to remove a background. Colorkey run on a room is a broken result, not a soft matte.
FAQ
Why does the cutout look perfect on white and fake on the real background?
White hides dark fringes and leftover source colour. The destination plate does not. Always QC on the actual backdrop and on a clash colour. A matte that only works on white is not finished.
Can I fix hair by running removal a second time?
Usually no. A second pass on an already-cut subject has less original edge to read, so it hardens further. Repair the matte you have, or go back to the uncut source. If you must re-run, re-run on the original file with a softer setting, not a harder one.
When is a green-screen output better than a transparent cutout?
When you have a keyer and you need spill control, variable softness, or a garbage matte. A baked transparent file has already decided the edge. A green plate postpones that decision. It is the right export when the composite will be graded and edged in an NLE rather than dropped onto a solid in one step.
Does a higher-resolution source give me better hair?
Only if the hair was actually resolved and the contrast was there. A 4K dark coat on a dark wall is still a dark coat on a dark wall. Generate or shoot the contrast; upscale later if you need the pixel count for delivery.