happytails.ai

Edge halo cleanup

Remove the white, black or colored fringe left around a transparent cutout by taking the old background color back out of the soft edge pixels. Download the cleaned cutout as a PNG with a map of the pixels that changed.

No files selected

Accepted files: .png,.jpg,.jpeg,.webp. Choose one file. Up to 20 MiB in total.

Your result

Report a problem or share an idea.

How to use Edge halo cleanup
  1. Choose a transparent PNG cutout.
  2. Pick the matte color the cutout was originally on, such as white for a product shot on a white background.
  3. Set how many pixels in from the transparent area to clean.
  4. Run the tool, check the changed-pixel map and download your PNG.

Useful next steps

How the fringe is removed

A soft edge pixel is a mix of the subject color and the old background: shown color = alpha x subject + (1 - alpha) x matte, the "over" operation from Porter and Duff, "Compositing Digital Images", SIGGRAPH 1984. The tool solves that equation for the subject color, F = (C - (1 - alpha) x M) / alpha, in encoded sRGB, and keeps the alpha value exactly as it was.

Which pixels change

Only partly transparent pixels within the edge band of a fully transparent pixel are cleaned, measured in whole pixels including diagonals. Fully opaque and fully transparent pixels never change, and pixels below the lowest alpha setting are left alone because their color is too uncertain. The changed-pixel map shows every cleaned pixel in white.

Limits of the method

The method assumes the cutout was made against one uniform matte color. Hair, smoke and motion blur shot against a busy background can lose detail or keep some fringe. Use PNG for exact results: browsers round partly transparent colors when they decode WebP or color-managed files.