piapia123
en

Background Colour Remover

Images

Everything runs locally in your browser — nothing is uploaded

Drop an image here, or click to choose

Or press Ctrl/⌘ + V to paste a screenshot

PNG / JPEG / WebP / GIF / BMP / AVIF · up to 30 MB each

Pick a colour (the top-left pixel by default) and turn it into transparency, giving you a transparent PNG. The test is RGB Euclidean distance, not “equals this colour”. An exact comparison picks up almost nothing on a real photo: after JPEG compression the pixels inside one flat colour wobble by about ±3. So matching goes by three-channel distance, and the 0–100 tolerance in the UI maps linearly onto 0 to `sqrt(3 x 255^2)` (about 441.7). “Only the area connected to the edges” is how background removal should work. A whole-image scan also removes same-coloured parts inside the subject (a white shirt, a white hat against a white wall). Flooding with a 4-neighbour walk from the four edges eats only the region touching the border, so a same-coloured area enclosed by the subject is left alone. Edge feathering and de-fringing deal with hard edges: a binary cut has jaggies, so feathering ramps alpha by distance from the removed area, and de-fringing solves the target colour back out of soft pixels with `F = (C - (1-a) T) / a`. Without it, cutting a blue background leaves a blue halo around the subject. Everything runs locally.

Features

  • Target colour from the top-left pixel by default, or set any colour by hand
  • Matching by RGB distance, so JPEG wobble of ±3 is still caught where an exact match is not
  • Connected-area mode floods 4-neighbour from the edges, sparing same-coloured areas inside the subject
  • Tolerance from 0 to 100, biased towards being conservative
  • Edge feathering from 0 to 5 pixels to soften the binary cut
  • De-fringing solves the target colour out of soft edges, so no halo remains
  • Exports a transparent PNG and reports what share of pixels was removed
  • Nothing is uploaded; it works offline

How to use

  1. Drop an image in
  2. Choose where the target colour comes from, or set it by hand, and adjust the tolerance
  3. Turn on connected-area-only for backgrounds, then tune feathering and de-fringing
  4. The result appears at once; click Download for the transparent PNG

FAQ

Why is a distance used instead of an exact colour match?
Because photos are lossily compressed: inside one flat area of a JPEG the pixels differ by about ±3. Comparing for an exact match hits so few pixels that almost nothing is removed. Three-channel Euclidean distance fixes that, with the 0–100 tolerance mapping onto 0 to about 441.7. The default 20 already removes most backgrounds without eating into the subject.
What does connected-area-only actually do?
It decides which pixels go. When on, a 4-neighbour flood starts from the four edges and removes only what touches the border and falls within tolerance, so a white shirt enclosed by a face and shoulders is untouched. When off it scans the whole image, removing every pixel close to the target colour, including same-coloured parts inside the subject. Keep it on for background removal.
What are feathering and de-fringing for?
A binary cut has hard, jagged edges that show a rim of the old background on light surfaces. Feathering ramps the edge alpha by distance from the removed area; de-fringing solves the leftover target colour out of soft pixels, so cutting a blue background leaves no blue halo. Turn both off when the subject edge is already clean.
Is the image uploaded?
No. The cut-out is done in your browser with canvas, entirely in local memory, and it works offline.

Related tools