Remove Image Background Online: When Colour-Based Removal Works

May 17, 20267 min readBy Muhammad Shabbir

How the CoditTools background remover decides what to delete, what it does to test images with labels and shadows, and how to shoot photos that cut out cleanly.

A potted plant on a warm photo background with a dashed green selection box, an arrow, and the same plant cut out on a grey and white transparency checkerboard

The CoditTools Background Remover does not detect the subject of a photo. It looks at the colour in the four corners of the image and makes every pixel of a similar colour transparent, wherever that pixel is. That makes it useful on a plain, evenly lit backdrop that differs from every part of the subject, and it explains exactly where it fails: a subject that shares a colour with the background, a shadow, a gradient, or a busy scene.

Knowing the rule lets you predict the result before you upload anything, and decide when a different kind of tool (one based on subject detection) is the right choice. This page explains the rule, shows what it does to three test images, and gives you a way to take photos that remove cleanly.

How the tool decides what to remove

  1. It averages a small square (18 × 18 pixels) in each of the four corners, then averages those four colours into one "background colour".
  2. For every pixel in the image it measures how far its red, green and blue values are from that colour.
  3. If the distance is within the background sensitivity (default 48 on a 10–120 slider), the pixel becomes fully transparent.
  4. If it is a little further, within the edge softness (default 34 on a 5–80 slider) beyond that, the pixel becomes partly transparent, more opaque the further away it is. This softens the cut edge instead of leaving a hard line.
  5. Pixels beyond both thresholds retain their current alpha in the processing loop. The result is encoded as PNG. Browser decoding and encoding can change metadata or colour handling; this is not a byte-preserving operation.
A graph of pixel opacity against distance from the corner colour: transparent up to 48, rising to fully kept at 82, with the defaults for sensitivity and edge softness
Sensitivity sets the first threshold; softness sets how wide the fade is.

Two consequences follow, and they cover nearly every disappointing result. The rule is applied to the whole image, not just to the area connected to the edge, so a pixel inside the subject that happens to match the background colour disappears too. And it measures colour only: it doesn't know what is a person, a bottle or a shadow.

What it does to three reproducible test images

These new examples use actual downloaded PNGs from the current tool, not recovered historical measurements. Every input is 200 × 200 opaque pixels with a white background and an 80 × 80 red rectangle at (60,50). Defaults are sensitivity 48 and softness 34. The four 18 × 18 corner samples remain pure white.

FixtureVerified output
Plain red rectangleAll 6,400 subject pixels remain opaque; all 33,600 background pixels become transparent.
White 20 × 20 label at (90,80)400 subject pixels become transparent: 6.25% of the rectangle. The algorithm removes the label along with the background.
Three grey 40 × 10 patches below the rectangleAt sensitivity48, 400 patch pixels remain opaque, 400 partly transparent, and 400 transparent. These hard-edged patches illustrate colour thresholds; they are not a realistic soft shadow.
Verified plain, label and grey-patch alpha counts for deterministic synthetic inputs.
Counts from the downloaded PNG alpha channel; no subject-detection model.

The grey patches start at (40,140), (80,140) and (120,140), with RGB values 180, 215 and 235 in every channel. With softness34, sensitivity80 leaves 400 opaque and no partly transparent patch pixels; sensitivity120 leaves no opaque and 400 partly transparent patch pixels. The red rectangle remains intact in these fixtures. A pale subject can still disappear as sensitivity rises.

Download the plain, label and grey-patch fixtures and compare the exact measurement records. Tests used Chrome157.0.8103.78 on Windows on18 November2026. Previous diagrams used historical illustrations whose source fixtures were unavailable; these newly documented counts replace them.

Which photos remove cleanly, and which don't

PhotoExpected resultWhy
Product on pure white or a single flat colour, evenly litGoodEvery background pixel is close to the sampled colour
Logo or icon with a flat backgroundGoodSame reason; edges are sharp, so little softening is needed
White product, white backgroundPoorThe subject is close to the background colour and is removed along with it
Subject with white or light details (labels, text, highlights, teeth, eyes)HolesThe rule has no notion of "inside the subject"
Soft shadows, reflectionsSmudgesShadows are a different colour from the backdrop but close to it
Gradient or vignetted backdropUnevenThe sampled colour is an average of the corners, so it matches the middle of the gradient but not its ends (see below)
Corners that differ (for example a subject touching one corner)UnpredictableThe four corner colours are averaged into a colour that may match none of them
Hair, fur, glass, motion blurRough edgesFine detail and semi-transparent edges blend with the background colour
Natural scenes, crowds, roomsNot suitableThere is no single background colour

A gradient has many background colours, but the tool uses one average corner colour. Depending on its range, some pixels can become transparent, some partly transparent and others remain. A subtle gradient is not a guarantee of a clean cut; inspect the downloaded result against both light and dark backgrounds.

Getting a clean result

Before the photo is taken

  • Photograph the subject on a backdrop that is clearly different in colour from every part of it. For a white product, use a mid-coloured backdrop and remove that instead.
  • Light the backdrop evenly, and move the subject away from it so its shadow falls elsewhere or is soft and faint.
  • Keep the four corners of the frame empty and the same colour as the rest of the backdrop.

In the tool

  1. Open the Background Remover and upload the image (any format your browser can open).
  2. Press Remove Background with the defaults, and look at the result against a contrasting colour. Check edges, any light areas inside the subject and the area under it.
  3. If background is left, raise the sensitivity a few steps at a time; if parts of the subject are disappearing, lower it. If the edge looks harsh or has a thin halo, change the edge softness.
  4. Download the PNG when it is right. If no setting gives a clean cut, the photo is outside what a colour rule can do.

Changing a slider does not update the result by itself; press Remove Background again each time. Start from the original opaque photo when comparing settings. The fade rule writes new alpha values and can make an already semi-transparent pixel more opaque; this is not a tool for preserving an existing transparent cut-out. Image processing happens in your browser, and the image is not uploaded.

Using the transparent PNG afterwards

  • A PNG with transparency is large for a photo. If you only need the cut-out on white, flatten it by converting to JPG with PNG to JPG; transparent areas are filled with white in the JPG.
  • To keep transparency but reduce the file size, use the Image Compressor; for a PNG it recompresses losslessly, and PNG to WebP usually gives a smaller file that still supports transparency.
  • Check the cut-out on the colour it will actually sit on. Edges that look fine on white can show a pale rim on a dark background.

When to use a different tool

If the subject has hair or fur, the background is busy, or you need the same quality across hundreds of product photos with shadows, a tool based on subject detection is the better choice. Many of those tools work by sending the image to a server or loading a large model, so check where your photos go before using them for anything private. The CoditTools tool is the better fit when the photo has a plain backdrop, when you don't want to upload images, or when you want predictable behaviour you can fix with two sliders.

Try the tools mentioned in this post - all free, no account needed.

Processing depends on the tool. Check its processing notes and our Privacy Policy for browser-based and server-assisted workflows.

Browse image tools →