7 min read

Remove a White Background Without Deleting the White Inside

Why an edge flood fill keeps the label on your product intact while “select all white” destroys it, which photos work, and which ones no automatic tool can rescue.

WHITE BACKDROP TRANSPARENT PNG

Every automatic background remover has the same failure mode: it removes the white parts you wanted to keep. A white logo on a mug, the page of a book, a white shirt against a white wall. The cause is a decision made at the start of the algorithm, not a lack of intelligence.

There are two ways to decide what counts as background, and they behave very differently.

Select-all-white versus flood fill from the edge

The naive approach collects every pixel above a brightness threshold and makes it transparent. It is fast, it handles a perfectly lit catalogue shot, and it deletes the inside of every white object in the frame.

The alternative is a flood fill that starts at the four edges of the image and spreads inward, stopping wherever the colour changes. Background is then defined by connectivity rather than by brightness: a white region only disappears if you can walk to it from outside the subject without crossing a non-white pixel. The white label on the mug is enclosed by the mug, so it survives.

removed backdrop only kept fill enters here Tolerance 24 The fill starts at the edge of the frame and moves inward until the colour changes. enclosed white kept Raise it for washed-out backgrounds; lower it for a shadow that must stay. Four edges, one pass, no model.
The fill enters from the edges and stops at the subject. Blue is what gets removed. The tint never reaches the enclosed white area, because there is no path from the border into it that stays white.Swipe the diagram sideways to read every label.

What this method is good at

The tolerance setting is the only real control, and it does one thing: it decides how close to pure white a pixel must be before the fill will step into it. Raise it for a washed-out or slightly grey backdrop; lower it when the subject has soft white edges that must not be eaten.

  • Products photographed on white or light grey seamless paper
  • Scanned documents and signatures that need a transparent surround
  • Logos and line art exported from a tool that flattened the background
  • Anything with a genuinely uniform backdrop and a clear silhouette

What no flood fill can do

These are the cases where a segmentation model — the kind that predicts a subject mask — is the right tool, and where a browser-side flood fill should say so rather than produce a ragged edge and call it done.

SituationWhy it fails
Soft shadows on the backdropA shadow is a gradient, not a flat colour — the fill stops at it and leaves a grey halo
Subject touching the frame edgeThe fill can enter from that side and eat into the subject
Hair, fur, feathersThe boundary is a blend of subject and background; there is no clean line to stop at
Glass and transparent objectsPart of the subject is literally the background showing through
Coloured or textured backdropNothing for a tolerance-based fill to recognise as background

Export as PNG, never JPG

JPEG has no alpha channel. Saving a cutout as JPG does not fail loudly; it fills the transparent area with white, which looks correct in the preview and defeats the entire exercise the moment the image is placed on a coloured background.

PNG stores transparency properly and is lossless, so edges stay exactly as cut. The trade is size: a transparent PNG of a product can be several times the JPEG it came from, because lossless compression cannot discard the noise in a photograph. If size matters more than transparency, you wanted a different export, not a lower quality.

Shoot for the cutout and skip the repair

If you control the photo, three changes make any tool’s output dramatically better: light the backdrop separately so it is brighter than the subject, keep the product at least a hand’s width from the paper so its shadow falls outside the frame, and shoot slightly overexposed so the paper clips to pure white. A backdrop that is already 255,255,255 needs no tolerance at all.

Try it without uploading

Every tool on Toolpix runs in your browser. No file is sent anywhere.

Browse all tools

TOOLS IN THIS GUIDE

Each one does the step described above, on your own device.