Skip to content
HandfulTools

How to remove the background from an image

What an automatic cut-out can and cannot separate, why hair and glass are hard, PNG versus WebP output, and how to fix the edges when the result is not clean enough.

· 7 min read

Removing a background does not erase anything from the photo. A model looks at the picture and produces a second, greyscale picture of the same shape — a matte — where white means "subject", black means "background" and the greys in between are partial coverage, which is what makes a hair edge look soft instead of cut with scissors. That matte becomes the image's alpha channel, or is used to paint a flat colour behind the subject. Every limitation below follows from that one idea: the result is only as good as the matte.

The quickest route here: open Remove Background, drop a JPG, PNG or WebP of up to 25 MB, pick Transparent, White or Colour under New background, choose an Output format, then click Remove background. The first run downloads a small model — about 7 MB, which your browser then caches — and after that the photo is processed entirely on your device. Nothing is uploaded, which matters when the picture is of a child, a passport page or an unreleased product.

What is doing the work

The model is MODNet, an open-source portrait matting network, run in the page by ONNX Runtime on WebAssembly. Two details explain most of what you will see:

  • It was trained to separate people from their surroundings. Products, pets and single objects on a fairly plain background usually come out well, but that is a bonus, not its job. Crowds, reflections and scenes with several competing subjects are where it drifts.
  • It looks at the image resized so its longest side is around 512 pixels, then scales the matte back up. That is why an eyelash comes out as a soft grey smear rather than a strand: at the size the model saw, it was a fraction of a pixel.

Before any of that, the tool caps your photo at 4096 pixels on the longest side to keep memory reasonable on phones: a 6000 × 4000 photo comes back at 4096 × 2731, while a 4032 × 3024 phone photo is untouched.

The routes, compared

Route Good for Watch out for
A browser tool like this one One image at a time, private, nothing to install First run downloads the model; a 4096 px cap
Photoshop (Select → Subject, then Select and Mask) Fixing hair and edges by hand with the Refine Edge brush Paid, and a real learning curve
GIMP (Fuzzy Select, or Tools → Selection Tools → Foreground Select) Free, full manual control, exports PNG with alpha Slow; needs Layer → Transparency → Add Alpha Channel first
Photopea Photoshop-style editing without installing anything Browser tab doing a heavy job
A server-side service such as remove.bg Bulk work through an API The image is uploaded to someone else's machine
ImageMagick Scripted work on flat studio backgrounds Keys out a colour, it does not find a subject

ImageMagick deserves a clarification: magick in.png -fuzz 10% -transparent white out.png makes every near-white pixel transparent. On a clean studio shot that is exact and repeatable; on a person in a room it punches holes in a white shirt.

Platform by platform

On macOS (Ventura and later), you can lift a subject without any tool: open the image in Preview or Quick Look, right-click on the subject and choose Copy Subject, then File → New from Clipboard and save as PNG. It is fast, but gives you no control and no plain-colour background.

On Windows, recent builds of Paint have a Remove background button in the toolbar, and the Photos app can blur or replace a background. Availability depends on how up to date the machine is.

On iPhone and iPad (iOS 16 and later), press and hold the subject in Photos until it lifts, then Copy it and paste it into Notes, Freeform or any app that accepts an image. What you get is a subject on transparency, not a saved PNG, so there is a step to do afterwards.

On Android, this varies by manufacturer: Samsung's Gallery lifts a subject on long press, while Google Photos' background tools are tied to specific devices or a subscription. There is no universal route.

What removing the background does to your file

  • The subject's pixels are untouched. Only the alpha channel is written. Colours, sharpness and resolution inside the subject are exactly as they were.
  • A transparent result needs a format with alpha. PNG and WebP have one; JPEG does not. If you pick Transparent with JPG, the tool switches to PNG and says so on screen.
  • PNG is exact and heavy; WebP is smaller. A full-resolution transparent PNG of a person easily runs to several megabytes; WebP with alpha is usually much lighter. JPG and WebP are written at quality 0.92.
  • Changing the background afterwards is free. Switching between Transparent, White and Colour, or changing the output format, re-renders from the matte already computed — the model does not run again, so it is instant.
  • The file is renamed. portrait.jpg comes back as portrait-no-bg.png.
  • One image at a time. There is no batch mode here.

The edge problem, and what to do about it

This is the failure you should expect rather than be surprised by. Because the matte is computed small and enlarged, the boundary of the subject is soft across a few pixels, and those semi-transparent pixels still carry some of the original background's colour. Cut a person out of a green room, drop them onto white, and a faint green rim appears around the shoulders and hair. Nothing in the tool removes that fringe.

Three practical responses:

  1. Shoot or choose for contrast. A dark subject against a light wall, or the reverse, gives a cleaner boundary than a beige jumper on a beige sofa.
  2. Crop before you cut out. If the subject fills a corner of the frame, crop the image around it first. The model then spends its ~512 pixels on the subject, not the room.
  3. Finish by hand when it shows. Open the transparent PNG in GIMP or Photoshop, add a layer mask and paint the rim away, or contract the mask by one pixel. For a web thumbnail this is never needed; for a poster it usually is.

Common problems, and what they mean

Hair looks chopped into a solid outline. Fine strands are below the resolution the model works at. Acceptable at screen size, visible in print. A manual touch-up is the only real fix.

A glass, a veil or bicycle spokes half-vanished. Genuinely transparent and very thin objects are the hardest case for any automatic matting: the model has no way to tell a see-through subject from the background. No setting changes this.

Part of the background stayed attached. Usually something physically continuous with the subject — the chair being sat on, a cast shadow, the hand holding the product. Try a photo where the subject stands clear.

The result is smaller than the original. Your photo was over 4096 px on its longest side and was scaled down first.

The model could not be downloaded. The first use needs a working connection to fetch the 7 MB model file. Corporate networks that block large downloads are the usual culprit; the tool says so, and you can retry.

The transparent PNG is too heavy to send. Switch the output to WebP, or run the PNG through Compress Image.

Questions people ask

Is my photo uploaded? No. Only the model file is downloaded, once. Your image is decoded, processed and re-encoded in the page.

Can I put the subject on another photo? Not here. This tool writes transparency or a flat colour. Export a transparent PNG and composite it in an image editor.

Why is the first image slow and the rest fast? The 7 MB model is fetched and compiled on first use, then cached.

Can I fix the edges inside the tool? No — there is no brush, no eraser and no edge-feathering control.

Is it good enough for an official ID photo? Check the rules first: many administrations specify the background colour, the framing and the head size, and some refuse edited photographs outright.

Next steps

Tools used in this guide

← All guides