You upload a photo, tap a button, and a few seconds later the background is gone and the person is floating on a transparent checkerboard. It feels like magic. It isn't — and understanding roughly what's happening explains both why it works so well and why it occasionally does something baffling.
The problem, stated properly
To a computer, your photo is just a grid of numbers. A 12-megapixel photo is twelve million pixels, each holding three values for red, green and blue. Nothing in that data says "this is a person" or "this is a wall behind them."
So background removal comes down to one question, asked twelve million times: is this particular pixel part of the subject, or part of the background?
The answer for any single pixel is genuinely ambiguous. A white pixel could be a shirt or a wall. What resolves it is context — what surrounds it, and what the overall shape looks like. That's precisely what a neural network is good at.
What the model actually produces
The AI doesn't cut anything out. It produces a second, greyscale image the same size as yours, called a mask. In that mask:
- White means "definitely subject"
- Black means "definitely background"
- Grey means "partly both" — which is exactly what you want at the edge of a strand of hair, where a single pixel really does contain some hair and some wall behind it
That mask is then used as the transparency channel of your original photo. Where the mask is white, your pixel stays fully visible. Where it's black, the pixel becomes fully transparent. Those in-between greys are what make a good cut-out look natural rather than cut out with scissors.
This is why hair is the hard part. A hard edge is easy — every pixel is clearly one thing or the other. Fine hair, fur and motion blur create thousands of pixels that are genuinely half subject and half background, and getting those greys right is what separates a good result from an obviously fake one.
How the model learned to do this
Models like this are trained on tens of thousands of images where a human has already produced a perfect mask by hand. The network makes a guess, its guess is compared against the human answer, and its internal settings are nudged slightly in the direction that would have been more correct. Repeat millions of times.
Nobody programs rules like "hair is thin and wavy." The model works out its own internal cues from the examples — early layers learn to notice edges and textures, deeper layers learn to recognise shapes like heads, shoulders and limbs, and the final layers combine all of it into a decision for each pixel.
Why the wrong model gives strange results
This is worth understanding, because it explains a failure people often blame on "bad AI."
There are two different families of model that look similar from outside:
Salient object detection
These are trained to find the most visually prominent thing in an image. On a close-up portrait, the most prominent thing is the face. So on a tight selfie, this kind of model can confidently return just the face and treat the person's own shirt as background. It isn't broken — it's doing exactly what it was trained to do, which just isn't what you wanted.
Background removal / matting
These are trained specifically on the task of separating foreground from background, using examples where the whole subject — face, hair, clothing, body — is marked as foreground. On the same selfie, this kind of model keeps the shirt.
Both are legitimate AI models. Choosing the right family for the job matters far more than any setting you can adjust afterwards.
Why it sometimes keeps things you don't want
A common case: a white cat lying on a white chair. The cut-out includes the chair.
This isn't a mistake in the usual sense. The model sees one connected, similarly-coloured mass with no clear boundary, and treats it as one subject. It has no way of knowing that you want the cat and not the furniture — that's your intent, not something visible in the pixels.
This is why every serious background removal tool includes a manual eraser. Some decisions simply cannot be inferred from the image alone, and a few seconds of rubbing with your finger resolves what no model can guess.
On-device versus server-side
There are two places this computation can happen, and the trade-off is real:
| On your device | On a server | |
|---|---|---|
| Speed | Slower (seconds) | Very fast |
| Your photo | Never leaves your device | Uploaded to a company |
| Cost | Free | Usually paid per image |
| Works offline | After first load | No |
Services that finish in two seconds are running the model on powerful hardware in a data centre, which means your image is transmitted and processed there. Tools that run in your browser are slower because a phone processor is doing work a server-grade chip would do — but the photo never leaves your hands.
PIXNIVO takes the on-device route deliberately. It's a few seconds slower, and your photos stay yours.
Try the background remover →How to get better results
Since you now know what the model is looking for, you can help it:
- Contrast between subject and background helps most. A dark jacket against a light wall is far easier than a white shirt against a white wall.
- Even lighting beats dramatic lighting. Heavy shadows create edges that aren't really the subject's outline.
- Avoid motion blur. If the edge is genuinely blurred, there is no sharp boundary for the model to find.
- One clear subject works better than a crowd. With several people the model has to decide which ones you meant.
- Use the eraser for attached objects. Furniture, held items and props that touch the subject usually need one manual pass — that's expected, not a failure.