How the background remover works
The tool uses an AI segmentation model: a neural network trained on thousands of photos where people marked exactly which pixels belong to the subject. When you add a photo, the model looks at a scaled-down copy (1024 × 1024 pixels) and gives every pixel a score from 0 (background) to 1 (subject). That grid of scores is called a mask.
The mask is then scaled back up to the size of your photo and used as the alpha (transparency) channel. Pixels with a score of 1 stay fully visible, pixels with 0 become fully transparent, and edge pixels in between become partly transparent. That is why hair and fur look soft instead of cut out with scissors.
If you choose a background colour, each pixel is blended with that colour using the standard “over” formula:
Example: an edge pixel of brown hair (red 120) with a mask value of 0.6, placed on white (red 255), becomes 120 × 0.6 + 255 × 0.4 = 174. The same sum runs for green and blue, for every pixel.
Two AI models: which one to pick
| High detail | Fast | |
|---|---|---|
| Model | BiRefNet Lite | ORMBG |
| Licence | MIT | Apache 2.0 |
| Download (once) | about 115 MB, or 224 MB on graphics cards without 16-bit support | about 44 MB, or 88 MB on most graphics cards |
| Best for | products, pets, plants, hair, complex edges | people, portraits, simple objects |
| Typical time with a graphics card | a few seconds | a second or two |
| Typical time on the processor only | a minute or more | 10–40 seconds |
The tool picks High detail when your browser supports WebGPU (fast graphics-card processing) and Fast when it does not. You can switch at any time. If one model leaves bits of background or cuts into the subject, try the other: they were trained on different photos and make different mistakes.
Where the AI runs, and what is downloaded
Everything happens in your browser. The model files are downloaded once from Hugging Face’s CDN and the AI engine (ONNX Runtime, through the Transformers.js library) from jsDelivr. Your browser stores them, so the next visit starts without the download. Your photo is never uploaded: you can switch off your connection after the model has loaded and the tool still works.
Very large photos are reduced to about 16 megapixels before processing, because phone browsers cannot handle bigger canvases. A 12-megapixel phone photo is processed at full size.
Tips for cleaner cut-outs
- Contrast helps. A dark subject on a light wall, or the other way round, gives the cleanest edges. Busy patterns behind the subject are harder.
- Keep the subject whole. A subject that is fully in the frame, with a little space around it, gives the most reliable result.
- Glass and smoke are hard. Transparent objects such as glasses, bottles and veils are partly see-through in reality, so they come out partly transparent.
- Groups work. The model keeps every main subject, so two people or several products stay together.
- Check the edges on a dark and a light colour. Click the black and white swatches: leftover background shows up as a halo on one of them.
Which file format to download
Choose PNG when you need transparency, for example for a logo, a sticker or a product you will place on a website. PNG files of photos are large, typically 3 to 10 MB. Choose JPG with a white or coloured background for marketplaces such as Amazon or eBay, which ask for a pure white background; JPG files are much smaller.
If the file is still too big for a form or a store listing, run it through the image compressor or resize it to the exact dimensions you need. To trim empty space around the subject, use crop image.
Making a passport or ID photo?
Background removal alone does not make a valid passport photo: the head also has to be the right size and position, and the print has to be the right size. The passport photo maker does all three for many countries and prints several copies on one sheet. Be aware that some passport offices do not accept photos with an edited background, so a plain light wall is often the safer choice.
For a full walk-through from photo to finished cut-out, see how to remove the background from an image.
Licences and commercial use
Both models are released under licences that allow commercial use: BiRefNet Lite under the MIT licence and ORMBG under Apache 2.0. Models with non-commercial licences are deliberately not used. The images you create belong to you; just make sure you have the right to use the original photo.