Cutting a person or product out of a photo used to mean half an hour of careful tracing with a pen tool, and hair was nearly impossible. Today an AI model does it in a few seconds, often with individual strands intact. It looks like magic, but the process is surprisingly understandable — and knowing how it works explains why some photos cut out perfectly while others need a touch-up.
This guide walks through what happens between dropping in a photo and downloading the cut-out, using PIXNIVO's in-browser background remover as the example.
Two problems in one: segmentation and matting
Removing a background is really two tasks:
- Segmentation — deciding which parts of the image belong to the subject and which belong to the background. This is the "where is the person?" question.
- Matting — deciding how much each edge pixel belongs to the subject. A pixel on a strand of hair may be 40% hair and 60% sky. A good cut-out keeps that pixel 40% visible rather than forcing it to be all or nothing.
Older tools handled only the first task, which is why their cut-outs had hard, jagged edges and hair looked like a helmet. Modern models produce a smooth "alpha matte": a greyscale map where white means fully subject, black means fully background, and every shade in between is partial.
How the model sees an image
Background-removal models are neural networks trained on many thousands of photos paired with hand-made, pixel-accurate masks. During training the network learns, layer by layer, what separates a subject from its surroundings:
- Early layers pick up simple features: edges, colour changes and textures.
- Middle layers combine those into shapes and parts: an ear, a shoe, the rim of a cup.
- Deep layers understand the scene as a whole — that this is a person standing in front of a building — which tells the model which region is the subject even where the colours are similar.
- The decoder takes that understanding back up to full detail and draws the boundary, pixel by pixel.
The hardest part is keeping both kinds of knowledge at once: the big picture that says "this is the subject" and the fine detail that says "this exact pixel is a hair". That's where the choice of model matters.
The model PIXNIVO uses: BiRefNet
PIXNIVO runs BiRefNet, an open-source model released under the MIT licence and designed for high-resolution, highly detailed segmentation. Its name comes from "bilateral reference": while it refines the boundary, it keeps referring back to high-resolution patches of the original photo and to maps of where edges are, so it can follow fine structures such as hair, fur and thin handles without losing track of the overall subject.
PIXNIVO runs the general-purpose version at its native working size of 1,024 × 1,024 pixels. That resolution matters: at lower working sizes, low-contrast edges — a dark jacket against a night sky, for example — tend to disappear.
What happens when you click "Remove background"
- The model loads. The first time, your browser downloads the model file — about 240 MB, thanks to compact 4-bit weights. The download is checked against a known fingerprint (a SHA-256 hash) and saved in your browser's storage, so later visits start in seconds.
- The photo is prepared. A copy is resized to 1,024 × 1,024 and its colours are normalised the way the model was trained to expect.
- The model runs on your graphics card. Using WebGPU, the browser's modern interface to the GPU, the network produces a 1,024 × 1,024 alpha matte. On most computers this takes a few seconds; older machines take longer.
- The matte is scaled up to your photo's full resolution and applied as transparency.
- Edge colours are cleaned. Semi-transparent edge pixels still contain some of the old background's colour — a green tint from grass, a blue cast from sky. PIXNIVO estimates the true foreground colour of those pixels and removes the fringe, using a published technique for fast foreground colour estimation (Forte and Pitié, 2021).
- The new background is applied — transparent, a colour you pick, or a blurred version of the original backdrop.
If your browser doesn't support WebGPU, your device has limited memory, or Data Saver is switched on, PIXNIVO automatically uses a lighter model (ISNet) instead and tells you why. It's quicker to download and runs on the processor, with somewhat less edge detail.
Everything stays on your device. Because the model runs inside your browser, your photo is never uploaded to a server. That's a meaningful difference for ID documents, unreleased products and personal photos, compared with services that process images in the cloud.
Why some photos cut out better than others
| Situation | Why it's hard | What helps |
|---|---|---|
| Subject and background are similar colours | Few visual cues separate them | Shoot against a contrasting backdrop |
| Glass, smoke, veils | The background genuinely shows through the subject | Expect partial transparency; touch up by hand |
| Busy backgrounds behind hair | Strands blend into the texture behind them | Plain backgrounds give the cleanest hair |
| Several overlapping subjects | The model must guess which are "the subject" | Crop to the subject you want first |
| Strong shadows on the floor | Shadows look like part of the object | Use soft light, or erase the shadow afterwards |
| Motion blur | The edge itself is smeared | Use a sharp photo |
Fixing what the model gets wrong
No model is perfect on every photo, so the Background Remover includes two manual controls:
- Edge tightening pulls the edge inwards slightly. Use it only when a thin line of the old background remains around the subject — edges are already colour-corrected, so most photos need none.
- Touch-up eraser lets you paint away leftover patches, such as a shadow or a bit of floor, with an adjustable brush and undo.
When you're done, download a PNG, the format that keeps transparency. For product photos destined for a marketplace, see how to create white background product photos.
Frequently asked questions
Why is the first use so slow?
The first run downloads the AI model, about 240 MB. After that it's stored in your browser and loads in seconds. Clearing your browser's site data removes it, and it's downloaded again next time.
Does it work on phones?
Yes, but phones and tablets with limited memory or no WebGPU support use the lighter model. Results are still good on clear subjects; for the finest hair detail, a computer gives the best results.
Can it remove the background from a logo or a drawing?
Often, yes, as long as the design stands out clearly from its background. For simple logos on a flat colour, the cut-out is usually clean.
Is the result good enough for professional use?
For most product photos, portraits and social media images, yes. Hair against a busy background or transparent objects may still need a few strokes with the eraser.