How AI background removal works

Understanding what the model is looking for explains most of the surprising results — including the empty ones.

Updated

Segmentation, not erasing

The model does not erase anything. It predicts a mask: for every pixel, a number saying how likely that pixel belongs to the subject rather than the background.

That mask becomes the alpha channel. High values stay opaque, low values become transparent, and the in-between values along the outline are what stop the edge looking like a cut-out-with-scissors.

Salient object detection is a specific idea

The model used here belongs to a family trained on salient object detection: given a scene, find the thing a person would say the picture is 'of'.

That framing explains its strengths — a product on a table, a person in a park, a dog on grass — and its blind spots. A photograph of a sky, a wall, a field of grass or a dense crowd has no single salient object, so the honest prediction is 'nothing here', and the result is an empty mask.

This is also why an empty result is worth reporting as a failure rather than presenting as a finished cutout. An empty file is not a background removal.

Why the model needs to see the background

Saliency is a comparison. The model decides what stands out by weighing a region against the rest of the image.

Crop tightly around an object and you remove the comparison: the crop is entirely subject, nothing stands out, and the mask comes back nearly empty. The fix is context — this tool pads a focus selection by roughly a third on each side before the model sees it, then cuts the result back to what you selected.

Where the difficulty really lives

Boundaries. Hair, fur, mesh, motion blur and transparent materials all produce pixels that are genuinely part subject and part background, and no binary answer is correct for them.

Model precision helps here, which is what the quality settings change: the same architecture at different numeric precisions, with the highest producing the most reliable fringes at the cost of speed and memory.

Running it in the browser

The model is a few tens of megabytes of weights executed through WebAssembly. Your browser downloads it once, caches it, and runs the arithmetic on your own hardware.

The trade-off is honest: the first run is slow, and a phone is slower than a workstation. In exchange, the image never leaves the device, there is no queue, no upload limit and nothing stored anywhere to be leaked later.

FAQ

Frequently asked questions

Is this the same technology as a phone's portrait mode?

Related but not identical. Portrait mode often has depth data from multiple cameras to work with. A background remover has only the pixels, so it relies entirely on what the image looks like.

Does the model learn from my images?

No. It is a fixed set of weights downloaded to your browser and run there. Nothing is sent back, and there is no training loop involved in using it.

Why do different tools give different results on the same photo?

Different models, different training data and different post-processing of the mask. On easy images they converge; on hair, glass and low contrast they diverge sharply.