Why a cutout gets a white edge — and how to remove it

A white edge is a thin rim of the old background that survives around a cutout — usually one to three pixels wide, and most visible against a dark backdrop. It happens because the matte is only an estimate of the boundary: pixels that are half subject and half old background keep some of the old colour.

The fastest diagnosis is a second opinion on the same photo: remove a background in your browser and compare the rim with the file you already have.

Where the pale pixel comes from

The model sees your image at 320 × 320. On a 1600 × 1600 export one model pixel covers five pixels of the original, so a boundary that looks clean in the matte is still soft in the file. Where the subject meets a white backdrop, that soft band is a mix of two colours: the subject, and the background you wanted gone.

Our pipeline handles it in two passes. A guided filter rebuilds the edge at full resolution using the real pixels as a guide, then the matte is tightened — a 2 px erosion followed by a smoothstep ramp — so the half-background band is pushed inward instead of being left semi-opaque. What survives is the subject, not the old backdrop blended into it.

How to get rid of it

  1. Confirm it is a rim, not noise.Zoom to 300 % against a dark background and check that the pale line follows the subject outline, which is the signature of leftover background.
  2. Start from the largest original you have.A re-saved or screenshotted JPEG has already baked a fringe into the pixels, and no downstream pass can tell that fringe from the subject.
  3. Run the cutout on that original.The guided filter and the 2 px alpha erosion need the real full-resolution pixels, not a previous export that was already flattened.
  4. Judge it on a dark colour.Check the PNG on a black or deep green panel, because a white page will happily hide the exact artefact you are looking for.
  5. Export once, at the size you need.Ask for up to 4096 px on the long edge, or 16 megapixels, so the refined edge is not resampled a second time on the way to print.

When a rim is not the tool's fault

One case stays outside our reach: a subject photographed against a white background with a light halo from the lens or a studio reflector. Those pixels are genuinely pale in the original, so tightening the matte makes the cutout smaller rather than cleaner. Shrinking the selection by a pixel or two is the honest fix there, and it still leaves a faint bright line on very dark surfaces.

The other case is a cutout that was saved as JPEG after the fact. JPEG has no alpha channel, so the transparent area is filled with a solid colour — usually white — before the file is written. If your PNG will be used on a coloured page, keep it as PNG all the way to the end.

Questions

Why does the white edge only show on a dark background?
The rim is a pale colour, so against white paper or a bright wall it blends in and you never notice it. Put the same PNG on a dark header or a black product shot and the leftover background pixels stand out at once. The edge was always there.
Is the halo my photo, or the tool?
Usually both. A model reading the image at 320 × 320 sees a coarse boundary, and a heavily compressed source adds its own pale fringe around a subject. The guided filter pass plus a 2 px alpha erosion remove most of it; a badly compressed original cannot be fully repaired.
Can I recover the old background from the cutout PNG?
No. The export sets the red, green and blue values of every fully transparent pixel to zero, so the old background colour is not in the file at all. Anything that claims to restore it is inventing pixels, which is why restored backgrounds look synthetic.
Does exporting at a larger size remove the white edge?
Not by itself. The matte comes from a 320 × 320 pass and is refined at full resolution; exporting up to 4096 px keeps that refinement instead of resampling it, so the rim stays the same visual width rather than growing with the file.

Last updated: 3 December 2026

If the rim is the symptom, the file format is the other half of the story, and a batch is the fastest way to check whether one photo or all of them are affected.