Skip to content

Why your background edges look bad, and how lighting fixes it

Background replacement is often blamed on the software when the room is what changed. Here is what these tools are actually looking for in your picture — and why that makes light, not settings, the thing to adjust.

Updated

What the software is really doing

A segmentation model takes your camera frame and returns a map of how likely each part of the picture is to be a person. That map is much smaller than the picture — in this app it is 256 by 144 pixels standing in for a frame up to 1920 by 1080. A single mask pixel therefore covers a block of your image, and the boundary it describes is the model's general idea of your outline rather than your outline.

Stretch that mask up naively and you get a boundary several pixels thick that sits somewhere near where you are — which in practice means a rim of your real room surviving around you. That rim, against a replacement backdrop, is what people call a halo.

So the mask is not stretched naively. It is re-sampled using your camera frame as a guide: for each output pixel, nearby mask samples are weighted by how closely their brightness in the camera image matches the pixel being filled in. Samples from across a real edge in the picture contribute almost nothing, so the boundary is pulled onto the edge that is genuinely present. The technique dates back to work published for Google Meet and it is why modern background replacement looks far better than it did five years ago.

And there is the catch. The whole method depends on there being an edge in your picture to snap to. Where the boundary between you and your room is invisible — a dark room, a wall the tone of your hair, your face in shadow against a bright window — the guide has nothing to say, and the result falls back towards the coarse mask you were trying to improve on.

The three fixes, in order of effect

None of them is a setting, and none of them costs anything.

  1. Light your face from roughly where the camera is

    A window you are facing, or any lamp beside the screen. This does two things at once: it gives your camera enough light to stop adding noise, and it makes the boundary between you and the room the brightest transition in the frame — which is exactly what the software is hunting for.

  2. Get away from the wall

    Two or three feet is enough. Distance separates you from the background in brightness and in focus, and it stops your own shadow landing on the surface the software is trying to distinguish you from. It is the cheapest improvement available and the one people never try.

  3. Remove the light behind you

    A bright window or lamp behind you is the single most destructive thing for this. Your camera exposes for the bright area, your face goes dark, and the edge the software needs disappears into shadow. Close the blind or turn round.

What each failure looks like

A flickering halo around your whole outline — not enough contrast between you and the room. Add light in front of you.

A shoulder or an arm briefly vanishing — the model itself is losing confidence, usually because you are dark or partly out of frame. Add light, and check you are not sitting at the edge of the picture.

A boundary that looks stepped or blocky — the mask's own resolution showing through, which happens where the guide finds a very strong edge and little else. Rarer, and generally improved by the same things.

Everything soft and slightly wrong all the time — you may be on a browser without WebGL2, in which case the app is compositing correctly but cannot run the refinement pass at all. Chrome, Edge, Firefox and Safari 16.4 or later all have it.

A stuttering, laggy preview — not an edge problem. That is your machine running out of frame budget; close other tabs and drop to 720p.

If it still is not good enough

Use a blur instead of a replacement backdrop. Its errors are hidden by its own effect, and it keeps the real light of your room, which is the thing that makes you look photographed rather than pasted on. For anything where you cannot control the room — an interview, most obviously — that is the choice that fails most gracefully.

And if a perfect edge is a genuine requirement rather than a preference, the honest answer is a physically plain, evenly lit backdrop and a keying pass in an editor. Live segmentation is very good; it is not a substitute for controlling the shot.

Frequently asked questions

Would a better webcam fix my edges?
Less than better light would. A better sensor produces a cleaner picture in poor light, which does help — but it does not create contrast that is not in the room. Someone with a cheap camera facing a window will get a better edge than someone with an expensive one in the dark.
Does a ring light help?
Yes, and for exactly the reason above: it puts light on your face from the camera position. Any lamp in front of you does the same job. What a ring light adds is consistency, not magic.
Why does it go wrong specifically around my hair?
Because hair is where the true boundary is genuinely ambiguous — individual strands are thinner than a pixel, so the correct answer for those pixels is "partly both", and any technique has to approximate it. Tied-back hair is easier than loose hair, and hair against a wall of a different tone is far easier than hair against a similar one.
My glasses cause problems. Anything I can do?
Tilt them very slightly down so the lenses do not reflect the screen straight back at the camera. A reflection is a bright feature in the middle of your face, and it can confuse both the segmentation and your camera's exposure.
Would a green screen make all this go away?
It removes the ambiguity, yes — an evenly lit backdrop of a single colour that is nothing like you is the easiest case there is. But the word doing the work is "evenly". A badly lit green screen with shadows across it is worse than a plain wall, so if you buy one, plan to light it.
How much does this actually change the result?
Enough to be the difference between using the effect and giving up on it. Every one of these tools finds edges that exist in the image; none of them can invent one. Two minutes moving a lamp will beat any amount of trying different backdrops.

Related

Change one light and try again

The fastest way to see whether any of this applies to your room is to record ten seconds before and after moving a lamp.

Open the studio