Remove a Plain Background

For pictures shot against one colour: a product on white, a logo on a flat field, a scan, a green screen. The tool finds the background by working inwards from the edges of the frame and cuts it away, keeping soft edges soft. It runs entirely in your browser, so the picture never leaves your machine. It is not a general background remover. A subject photographed in a room or a street needs a trained model, and this deliberately has none.

Works on backgrounds that are one colour. The chequerboard behind the picture is what transparency looks like; it is not part of the image.

Which pictures this works on

PictureResult
Product on a white sweepExact, including soft edges
Logo or icon on a flat colourExact
Scanned document or signatureExact
Green screenExact, at a wider tolerance
Portrait against a plain wallUsually good; raise the tolerance for shadows
Anything in a room, a street or a parkPoor: large pieces of background stay
Subject the same colour as its backgroundImpossible, by any method

The method is a flood fill inwards from the edges of the frame: whatever is within a colour tolerance of the border, and joined to it, is removed. That is why a plain background comes away cleanly and a scene does not: a tree and a wall are not the colour of the frame's edge, so the fill stops at them and leaves them attached to your subject.

It also means a patch of background colour inside the subject is safe. A white shirt photographed on white keeps its shirt, because the fill never reaches it. Tools that simply delete every white pixel punch a hole straight through.

Using the tolerance

Tolerance is how far a colour may sit from the border colour and still count as background. It is the only control that matters, and the right value depends on the picture rather than on taste.

  • A rim of background left around the subject: raise it. Pixels that are almost entirely background are being kept.
  • The subject is being eaten (especially pale parts): lower it. Its colour has come within reach of the background's.
  • Nothing at all is removed: the background is not one colour. Raising the tolerance may rescue a shaded or gradient backdrop; it will not rescue a photograph taken in a room.

There is no fringe to clean up afterwards. A half-transparent pixel cut from white still holds half white, so the tool subtracts the background's colour back out of every partly transparent pixel before saving, which is what lets the cut-out sit on a dark page without a pale halo around it.

Why there is no AI here

The tools that cut a person out of a busy photograph run a trained segmentation model. That is a download of several megabytes and a build step to package it, and this site has neither: no runtime dependencies and no bundler, so there is nowhere for a model to come from even if one were wanted, and the site’s security policy sets connect-src ‘none’, so the browser blocks network requests from these pages.

The choice was between doing the general case badly and doing a specific case exactly. Against a plain background this is not an approximation of a better method; it is the right answer, measured against known-correct results at zero error including anti-aliased edges. For everything else, it is better to state the limitations clearly than to return a messy result and let you work it out.

Frequently asked questions

Is my picture uploaded anywhere?

No. Your browser decodes the file, works out the mask and encodes the result, all locally. The site’s security policy sets connect-src ‘none’, so the browser blocks network requests from these pages, meaning the picture could not be sent even if the code tried.

What kind of pictures does this work on?

Anything shot against a single colour: a product on a white sweep, a logo, a scanned document, a passport-style portrait on a plain wall, a green screen. Against those it is exact, including anti-aliased edges. Against a scene (a person in a park, a room, a street) it leaves large parts of the background behind, because a tree and a wall are not the colour of the frame’s edge.

Why does it not use AI like the big tools?

Because that needs a trained segmentation model, which is a several-megabyte download and a build step. This site has no runtime dependencies and no build step, so there is nowhere for a model to come from, and the site’s security policy sets connect-src ‘none’, so the browser blocks network requests from these pages. The better choice was to handle the case that pure arithmetic does well and state clearly which case that is.

The edge has a pale fringe on my dark background. Why?

It should not. A half-transparent pixel cut from white still holds half white, so the tool subtracts the background’s colour back out of every partly transparent pixel before saving. If you still see a rim, the tolerance is probably too low, so pixels that are almost entirely background are being kept as subject. Raise it a little.

Which format should I save as?

PNG for a transparent cut-out that has to be exact (logos, product shots, anything with sharp edges). WebP if the file size matters more and the destination supports it. JPEG only if something old demands it, and then the transparency is gone: the cut-out is flattened onto whichever colour you pick.