AI Background Removal: When It Works, When It Fails, and Why You Needn't Upload

Updated · by Hakeem and Ahmad

AI background removal works well when a photo has one clear subject, a person, a product or a pet, that differs in colour from what is behind it. It struggles with loose hair, similar colours where subject and background meet, transparent objects, and pictures with no obvious main subject. And you don't have to upload a personal photo to a website to do it: a small model can run in your browser, on your device, and it is good enough for most ordinary photos, though its edges are softer than those of large server-side models. This article explains what is happening, where it goes wrong, and what to do when it does.

What does the AI actually do?

The model does not "understand" the picture the way you do. It is a neural network trained on thousands of labelled images to answer one question for every pixel: does this belong to the most prominent thing in the picture? The answer is a grey "mask": white for the subject, black for the background, shades in between at the edges. That mask becomes the transparency of a PNG.

In Remove Background, choosing "AI cutout" runs U²-Net in its small version (u2netp), open source under the Apache 2.0 licence, 4.57 MB. It downloads with the engine that runs it (about 7 MB together) the first time only, then reads the photo on your device. The photo is not sent to any server, ours included.

The detail that explains most of its mistakes: the model sees your photo shrunk to 320 × 320 pixels. The mask is then scaled smoothly back up to your photo's size. So edges always come out slightly soft, and a single strand of hair that has shrunk to a fraction of a pixel simply isn't there for the model to see.

What did we measure?

Before launch we tested it in three browser engines (Chromium, Firefox and WebKit) on a desktop:

  • On a synthetic test picture (a disc over noisy stripes) the mask matched the true shape with an IoU of 0.986, meaning 98.6% overlap between what was cut out and what should have been.
  • On a real portrait the background corners were cleared and the face and body kept whole. That is a visual check, not a number.
  • Time: 2.5 to 3.7 seconds in Chromium and WebKit, about 32 seconds in Firefox (the tool warns you). We have not timed phones; older ones are slower.

That is not a benchmark over hundreds of photos, so we make no claim that it beats other tools. What we can say is that it works on the photos it is meant for, and that you should check every result.

When does it fail, and what can I do?

Situation What happens What to do
Loose hair or fur Strands vanish, or keep a halo of background Shoot against a plain background that contrasts with the hair; accept a soft edge; or use a desktop editor for hair work
Subject close in colour to the background (white shirt, white wall) The edge melts and part of the subject may go Reshoot against a different background; side light separates the edge
Several people, or no clear subject It may keep one person and drop another, or keep part of the background Crop the image around what you want first
Transparent things (glass, spectacles, net curtains) They turn solid or disappear No single mask handles this well; it is a job for manual editing
Thin parts and gaps (bicycle spokes, a mug handle) The gaps fill with background A closer shot, or manual editing
A small object in a large picture It becomes a few pixels in the model's eyes Crop around it first so the model sees it larger
A logo or graphic on one flat colour Edges softer than they need to be Use the tool's "Colour key" method, which gives crisp edges on flat graphics

The rule of thumb: whatever makes the boundary hard for your eye makes it harder for the model.

Why not just upload it to a background-removal site?

The photos people cut out are usually personal: a CV photo, a picture of a child, an ID card, an unreleased product. Most background-removal sites work on their servers; many want an account or limit free images, and some terms allow the original to be kept for a time. The issue isn't that every site is careless; it's that you can't check what happens to your copy.

Those sites do have a real advantage: bigger models. The high-quality cutout models available today are roughly 40 to 170 MB and handle hair better than a model under 5 MB. For a photo that isn't sensitive and needs perfect hair, that can be worth it. For a personal photo, the small model on your own device is enough most of the time.

On an iPhone (iOS 16 and later) you can also touch and hold the subject in the Photos app to lift it off the background and copy or share it; that runs on the phone too.

I need a white background for an official photo. What now?

The best route is always to take the photo against a white or light wall with even light. If you can't:

  1. Remove the background with Remove Background ("AI cutout") and download the PNG.
  2. Open that PNG in Passport & Visa Photo Resizer. It draws the photo over white, so the transparent area becomes white, and saves a JPG at the exact size and file limit you need.
  3. Check the edges of the hair and shoulders, zoomed in, before you upload.

Be aware that some authorities reject digitally altered photos, and some portals detect unnatural edges. Check the rules of the office you are applying to, and if a photo has already been refused, read Why Do Passport and Visa Photos Get Rejected?.

Quick answers

Why can't I save the result as JPG? JPG has no transparency, so the clear background would be filled with a solid colour. Save a PNG, and convert later if you want a particular background colour.

Does the AI cutout work offline? It needs a connection the first time, to download the model and engine. The photo itself never needs a connection and never leaves your device.

Why was it so slow in Firefox? In our tests it took about 32 seconds in Firefox against about 3 seconds in the other engines on the same machine. The result is the same; for many photos, use Chrome, Edge or Safari.

Does the location stay in the output? The tool draws a new picture, so EXIF data, location included, is not carried into the PNG. If you will share the original too, clean it with Remove EXIF.

What to do next

Try "AI cutout" in Remove Background and check the edges on both a light and a dark page. For a logo on one colour, try "Colour key" first. If the photo is for an application, finish it in Passport & Visa Photo Resizer.

Try the tool

Remove the background from a photo with an on-device AI cutout, or remove a plain single-colour background, and download a transparent PNG.

Open Remove Background →

More guides for Image Tools

Browse all Image Tools →