Browser-based AI · the picture never leaves this tab

AI Background Remover

Pick a photo and a small segmentation model (MODNet, Apache-2.0) finds the subject and cuts the background away on your own device. Save a transparent PNG, put the subject on a flat colour, or drop it onto another picture, with a feather control for the edge.

Picture

PNG, JPG, WEBP, GIF or BMP, up to 25 MB. You can also paste with Ctrl+V.

Drop a picture here or click to choose

.png, .jpg, .jpeg, .webp, .gif, .bmp

Background

Behind the subject

Edge

Feather is measured as if the picture were 1000 px wide and scales with its real size. Both controls act on the saved result too.

Save

A transparent cut-out is always saved as PNG, because JPG cannot hold transparency.

AI Background Remover (Runs in Your Browser)

Operator: Abdulla Al Fahad. How tools are built and checked

Removing a background used to mean either a patient hour with a selection tool or sending the photo to a service that charges per image. This page does the cut-out with a small neural network that runs inside your browser tab. You pick a photo, press one button, and get a mask that separates the subject from what is behind it, then choose what goes behind the subject instead.

The network is MODNet, a portrait matting model published under the Apache-2.0 licence, in the ONNX conversion hosted as Xenova/modnet. It was built for people, so a head-and-shoulders photo, a full-length portrait or a pet photographed against a plain wall tends to come out cleanly. It is not a general object cutter, and the limits section says where it struggles.

This is not the same job as the Remove White Background tool on this site. That one clears pixels close to a single chosen colour, so it suits a product on a white sheet. This one recognises the person in the picture, so it also works when the backdrop is a living room or a street.

Key features

  • A MODNet matting model (Apache-2.0, about 26 MB) that downloads once and is then cached by the browser
  • WebGPU when the browser offers it, with an automatic fall back to the WebAssembly CPU backend
  • Transparent PNG, a solid colour of your choice, or your own background picture covering the frame
  • A feather control from 0 to 20 and an edge position control from -30 to +30, both applied to the saved file as well as the preview
  • A before and after slider, drawn over a checkerboard so transparency is visible
  • Paste, drag and drop or file picker input, with a Stop button while a run is under way

The MODNet matte, feathering and what gets saved

The page accepts PNG, JPG, WEBP, GIF and BMP files up to 25 MB and 50 megapixels, recognised by their contents rather than their extension. A GIF contributes its first frame. HEIC photos are refused with a request to convert them first; the HEIC to JPG tool on this site does that. You can also paste a picture from the clipboard with Ctrl+V or Cmd+V.

The cut-out is made at the picture's own size, except that a picture whose longest side is over 4096 pixels is scaled down to 4096 first and the page tells you the new size. The model itself never sees more than about 1024 by 512 pixels: the picture is shrunk so its shortest side is about 512 (and its longest at most 1024), with both sides rounded to a multiple of 32. The matte it returns is stretched back to the working size with bilinear smoothing, which is why very fine detail such as single hairs is approximate.

Three outputs are offered. Transparent saves a PNG whose alpha channel is the matte. Solid colour fills the background with any colour you pick, saved as PNG or JPG. Picture scales and crops a second image to cover the whole frame and puts the subject over it. JPG has no transparency, so the Transparent mode always saves PNG and the format menu is locked while it is selected. Saved files are named after the original with -no-bg or -new-bg added, and no watermark is drawn.

The original photo's EXIF block, camera details and any embedded location are not carried into the saved file, because the result is a fresh canvas encode. If you need the metadata to survive, this tool will not keep it.

How it works

On the first run the page imports the Transformers.js library, asks the browser whether a WebGPU adapter exists and downloads the model file from huggingface.co. The ONNX runtime's WebAssembly helper is served from this site, not a third-party CDN. A progress bar shows megabytes received of the total. The picture is turned into numbers in memory.

The picture becomes a tensor of three colour planes scaled to the range -1 to 1, which is how MODNet was trained. The network answers with one plane of values between 0 and 1, a soft matte where 1 means certainly subject. The page clamps it to whole bytes and stretches it to the working size.

Shaping happens after the model, so moving a slider does not re-run it. The edge position control shifts the middle of the matte's ramp by up to 30 percentage points and applies a gain of 1.6, which makes the edge firmer. The feather control then blurs the alpha channel with three box-blur passes in each direction, which approximates a Gaussian. The blur radius is feather x longest side / 1000 / 2 pixels, so a setting of 4 on a 4000 pixel photo is a radius of 8 pixels and looks like 4 on a 1000 pixel one.

If the WebGPU run fails, for example because the graphics driver rejects the model, the page quietly retries once on the CPU backend before it shows an error.

Common use cases

  • Cutting a person out of a group holiday photo to use as a transparent PNG on a slide or poster
  • Putting a head-and-shoulders photo on a flat grey or blue backdrop for an internal staff directory
  • Placing a pet photographed indoors onto a seasonal background picture for a greeting card
  • Isolating a handmade item shot against a plain wall for a first draft of a shop listing image

How to use this tool

  1. Drop a photo on the box, click it to choose a file, or press Ctrl+V with a picture on the clipboard.
  2. Read the download note, then press Remove background. The first run shows the model download; later runs go straight to cutting.
  3. Slide the compare handle to check the edge. Raise Feather for hair or fur, or move Edge position up to trim a pale halo.
  4. Pick Transparent, Solid colour or Picture under Background. For a picture, choose the backdrop file.
  5. Choose PNG or JPG (JPG is only available for colour and picture backdrops) and press Download picture.

Example

A 6000 by 4000 portrait photo, feather 4, edge position 0, saved on a solid blue backdrop

Photo            6000 x 4000, JPG, 5.1 MB
Background       Solid colour #3b82f6
Feather          4
Edge position    0
Format           JPG, quality 92

What the page works out and saves

Working size     4096 x 2731 (longest side capped at 4096, scale 0.6827)
Model input      768 x 512 (shortest side 512, both multiples of 32)
Blur radius      4 x 4096 / 1000 / 2 = 8.2, used as 8 px
Saved file       portrait-new-bg.jpg, 4096 x 2731

Tips for best results

  • Start with a photo where the subject differs from the background in colour and brightness. The model finds people more reliably than objects, and a plain wall helps more than a busy shelf.
  • Raise Feather to 3 or 4 for hair and fur, and drop it to 0 or 1 for a hard-edged logo-style subject.
  • If a pale halo of the old background remains, move Edge position up by 5 to 10 before you reach for a larger feather.
  • When the subject goes on a new picture, choose a backdrop with a similar light direction; a soft blur on the backdrop file before you load it hides the difference in sharpness.
  • Run once on a downscaled copy if you only want to test the result; the cut-out time depends mostly on the backend, not on the photo size, because the model input is capped near 1024 pixels.

Common pitfalls

MODNet is trained on portraits. Products, furniture, cars and animals in cluttered scenes can come out with holes or with part of the background kept. Check the whole frame with the slider before saving.

The matte is computed at roughly 512 by 768 and stretched up, so single strands of hair and fine mesh are approximated rather than traced. A large feather will not recover lost detail.

Transparent PNG files from a large photo are big. A 4096 pixel wide cut-out can be several megabytes, and a JPG on a solid colour is much smaller.

Without WebGPU the model runs on the CPU, which is slower and uses more memory. Close heavy tabs first on an older phone.

The first run needs internet access to fetch the model and the runtime helper. After that the model is in your browser's cache, but clearing site data removes it and the next run downloads it again.

Common errors and how to fix them

The model files could not be downloaded
The 26 MB onnx/model.onnx file of Xenova/modnet is fetched from huggingface.co. A network filter, a VPN or a content blocker that blocks that host stops the first run. Allow it, or try another network, and press the button again.
Background removal failed with a memory or session error
Reload the page so the model is created fresh, then try a smaller picture. On a phone, close other tabs; the CPU fallback needs more memory than the graphics backend.
"is a HEIC photo, which this tool cannot read"
Convert the photo to JPG first with the HEIC to JPG converter on this site, then load the JPG here.

Best practices

  • Judge the cut-out against the backdrop you will actually use, not only the checkerboard; a halo that is invisible on grey can show on a dark colour.
  • Save a transparent PNG as your master copy and make colour or picture variants from it when you need them.
  • When one subject appears in several photos, note the feather and edge values that worked on the first and reuse them, so every cut-out has the same outline softness.

What the model download involves

The fp32 version of Xenova/modnet is about 26 MB. A quantised version of roughly 6.6 MB exists on the same model page, but this page uses the full-precision one so that no accuracy is traded away for download size. Browsers store downloaded model files in their cache, so a second visit does not repeat the download unless you clear site data or the browser evicts it.

The model's licence is Apache-2.0, which permits commercial use of the cut-outs you make. The picture you cut out is yours; nothing about the tool adds a mark or claims rights over it.

WebGPU, WebAssembly and why the speed differs

With WebGPU the network runs on the graphics chip, which is normally much faster than the CPU once the model is loaded. Without it the same network runs as WebAssembly on the CPU. The result is the same either way; only the time and the memory use change. The page shows which backend ran under the buttons so you can tell which one you got.

Browsers or devices without a WebGPU adapter (older Safari, some Linux and Android setups) fall back to the CPU path automatically, and nothing needs to be switched on.

Frequently asked questions

What does the page download, and from where?

The onnx/model.onnx file of Xenova/modnet (about 26 MB) comes from huggingface.co, and the ONNX runtime's WebAssembly helper is served by this site. Your photo is not part of either request: it is decoded and processed in browser memory, which you can confirm in the network panel.

Why are there no free-hand touch-up brushes?

This page produces one automatic matte and lets you shape its edge with two sliders. A brush for painting areas back or away is not built. For fixes that need a brush, take the transparent PNG into an image editor.

Can I process many photos at once?

One picture at a time. The model is cached after the first run, so doing several in a row only repeats the cutting step, not the download.

Why is a JPG not offered for a transparent result?

JPG cannot store transparency. A cut-out with a transparent background is always saved as PNG; choose a solid colour or a background picture if you want a JPG.