Image background remover

Instantly remove solid or near-solid backgrounds using smart edge-flood fill — no AI models, no uploads, runs entirely in your browser.

Drop your image here

or click to browse files from your device

Supports JPG, PNG, WEBP · Max 30 MB

100% private – no uploads Instant processing Transparent PNG output Works offline
Original Result
Processing…
💡 Click anywhere on the image to sample the background color
Best results: works best on images with a solid or near-solid background (white, black, blue, green, etc.). Adjust Tolerance if too much or too little is removed.

Background Color

Current color

Higher = removes more similar shades. Start at 20–40.

Softens jagged edges. 1–3 px recommended.

Export

Download with background color

Download exports at original resolution. Processing large images may take 1–2 seconds.

Flood fill from the borders with a colour distance test

The tool starts from a seed colour, either auto-detected from the image corners or taken from the pixel you click in sample mode. It then seeds a flood fill from every pixel along all four borders of the image and expands inward using eight-way connectivity, so diagonal neighbours count as connected and corners are handled cleanly.

Each candidate pixel is compared with the seed colour using Euclidean distance in RGB space: the differences in red, green and blue are squared, summed, and square-rooted. The largest possible distance, between black and white, is the square root of three times 255 squared, which is about 441.67. Your tolerance percentage is scaled against that maximum, so a tolerance of 30 sets the cut-off at roughly 132.5.

Pixels within the cut-off are marked as background and their neighbours are queued for the same test. Pixels outside it stop the fill. The marked pixels have their alpha set to zero, making them transparent. The feather setting then softens the boundary by applying partial alpha within a small radius of the cut edge, which removes the jagged stair-stepping a hard binary mask produces.

Choosing a tolerance on a white studio shot

Take a product photo on a white background, so the seed colour is 255, 255, 255. Set tolerance to 30, which as shown above puts the cut-off at about 132.5.

A slightly grey pixel from the background's shadow gradient at 240, 240, 240 differs from the seed by 15 in each channel. Squaring gives 225 per channel, 675 in total, and the square root is about 25.98. That is far below 132.5, so it is removed, which is what you want.

Now consider a mid-grey pixel at 180, 180, 180. Each channel differs by 75, so the distance is 75 times the square root of 3, about 129.9. That is still just under the 132.5 cut-off, so at tolerance 30 a mid-grey part of your subject would be removed if it touches the background region. Drop the tolerance to 25 and the cut-off falls to about 110.4, which now protects that grey.

This is why the recommended starting range is 20 to 40. Begin at 30, look at the edges, and move in steps of five rather than jumping to an extreme.

What this technique handles well, and what it does not

Colour-distance flood fill is excellent on studio shots, product photos on seamless backdrops, logos, screenshots, scanned documents and anything with a clearly separated subject against a flat backdrop. It is fast, predictable and gives you direct control over the threshold.

It struggles where the background is not flat: gradients, textured walls, outdoor scenes and photographs where lighting falls off across the frame. It also struggles with soft or semi-transparent edges such as hair, fur, smoke, glass and motion blur, because each pixel is judged individually against one colour and there is no model of partial coverage. Feathering improves the look of those edges but cannot reconstruct the detail.

The other classic failure is a subject that matches the background. Because the fill spreads from the borders, an enclosed area of background colour inside the subject, such as the gap in a handle, will not be removed unless it connects to the outside; conversely a white shirt touching a white backdrop will be eaten. If that happens, lower the tolerance, or sample a different point in the background rather than relying on corner detection.

Frequently Asked Questions

Start between 20 and 40, with 30 a sensible default. Higher values remove more shades similar to the background, which helps with soft shadows but risks eating into the subject. Adjust in steps of about five and watch the edges rather than making a large jump in one move.
Not well. The method judges each pixel by how close its colour is to a single sampled background colour, so it needs a flat or near-flat backdrop. Gradients, patterned walls and outdoor scenes contain too much colour variation for one threshold to separate cleanly from the subject.
Because that part is close in colour to the background and connected to it. The fill spreads inward from the borders through neighbouring pixels within tolerance, so a pale subject against a pale backdrop merges. Lower the tolerance, or use sample mode to click a background point that is more distinct from the subject.
It softens the boundary between kept and removed pixels by applying partial transparency within a small radius of the cut, rather than switching abruptly from opaque to invisible. One to three pixels is usually enough to remove jagged stair-stepping without making the subject look blurred around its outline.
No. The processing runs on the HTML canvas inside your browser using the Canvas API, with no libraries and no uploads, so the picture never leaves your device. The tool accepts JPG, PNG and WEBP files up to 30 MB and exports a transparent PNG, or a PNG with a replacement background colour.