All guides
Images6 min read

How Automatic Background Removal Actually Works

Why modern background removers handle hair and glass when the old magic wand could not — segmentation models, alpha masks, and where they still fail.

Cutting a subject out of a photograph used to be skilled manual work. The change over the last few years is not that the tools got faster — it is that they started solving a fundamentally different problem.

The old approach: matching colours

Traditional selection tools worked on colour similarity. The magic wand picked a pixel and expanded outwards while neighbouring pixels stayed within a tolerance. Chroma keying — the green screen — is the same idea with a controlled background.

This works when the background is uniform and distinct from the subject, and fails whenever it is not. A person in a grey jumper against a grey wall defeats it entirely, because colour alone carries no information about where the person ends.

The current approach: predicting a mask

Modern background removal uses a segmentation model trained on large numbers of images paired with hand-made cutouts. Rather than matching colours, it predicts for every pixel how likely that pixel is to belong to the foreground — learning from shape, texture, edges, and context rather than from hue.

This is why it copes with a grey jumper on a grey wall: the model has learned what people look like, so it can find the boundary without a colour difference to guide it.

Why the alpha channel matters for hair

The other significant improvement is that the output is not a binary in-or-out decision. Each pixel gets an alpha value from 0 to 255, so it can be partially transparent.

This matters enormously at edges. A pixel at the boundary of a strand of hair genuinely contains a mixture of hair and background — a hard decision either way produces the jagged fringe or the pale halo that gives away a cheap cutout. Partial transparency lets that pixel be half hair, which is what it actually is. The same applies to motion blur, glass, and smoke.

Where it still struggles

  • Fine detail against a busy background — chain-link fences, bare branches, lace.
  • Transparent objects, where the model must decide whether to keep what is visible through the glass.
  • Low contrast between subject and background, which remains harder even for a trained model.
  • Unusual subjects. Models are trained mostly on people, products, and animals; something outside that distribution gets worse results.
  • Shadows, which are ambiguous by nature — whether a cast shadow belongs to the subject depends on what you intend to do next.

Getting better results

  1. Start with the highest resolution version you have; the model has more edge detail to work with.
  2. Photograph with contrast in mind if you control the shot — separation between subject and background still helps.
  3. Avoid heavy compression before removal, since JPEG artefacts around edges confuse boundary prediction.
  4. Check the result against a background very different from the original, where halos become obvious.

Running in the browser

These models are now small enough to run client-side via WebAssembly, which changes the privacy position entirely. Most background removers require an upload and an account before showing a result — meaning your photograph sits on someone's server. Running locally means the image never leaves your device, at the cost of a one-time model download.

Mavertex's Background Remover runs a segmentation model in your browser through WebAssembly. The first run downloads the model; after that it is cached. Your photo is never uploaded.

Try it yourself

Free, browser-based, no sign-up.

Open Background Remover