Tutorials
How to remove white edges (halos) from a transparent PNG
Why cut-out PNGs sometimes show a thin white or coloured outline on dark backgrounds, and how to clean it up in Photoshop, Photopea, GIMP, Canva and Figma.
By the pngtop team · · 5 min read
You place a transparent PNG on a dark background and a thin, bright line appears around it, like a ghost of the background it was cut from. That line is called a halo or fringe, and it is the most common reason a cut-out looks "pasted on".
This guide explains where halos come from, how to spot them before you download, and how to remove them with the tools most people already have.
Why halos happen
A transparent PNG stores an alpha channel: a value for every pixel that says how opaque it is. Edge pixels are usually partly transparent, so the object blends smoothly into whatever is behind it.
The problem is the colour of those edge pixels. If the image was cut out from a white photo background, the semi-transparent edge pixels still contain a little of that white. On a white or light page you never notice. On a dark page, the white shows through as a pale outline.
The same thing happens with any background colour: an object cut from a green screen can carry a green fringe, and one cut from a blue sky can keep a faint blue edge.
If you want a refresher on how transparency is stored, read what a transparent PNG is.
Check for halos before you download
On pngtop, every image is previewed on a checkerboard. Zoom in on the edges and look for:
- A light line that follows the outline of the object.
- Soft areas, such as hair or fur, that look grey or milky instead of fading cleanly.
- Small specks of background colour trapped between fingers, leaves or wheel spokes.
A quick test in your own design is even better: drop the PNG onto a very dark rectangle. Halos that are invisible on white become obvious on black.
Fix 1: Defringe in Photoshop
Photoshop has a dedicated tool for this problem.
- Open the PNG and make sure the layer is not locked (double-click the layer and press OK if it says "Background").
- Go to Layer → Matting → Defringe.
- Enter 1 pixel for most images, or 2 pixels for large photos, and press OK.
Defringe replaces the colour of the edge pixels with the colour of nearby pixels inside the object, so the edge keeps its softness but loses the background tint.
If the image was cut from pure white, Layer → Matting → Remove White Matte is even more precise. Use Remove Black Matte for images cut from black.
Fix 2: Shrink the edge with a layer mask
When a halo is wider than a pixel or two, contract the selection:
- Ctrl/Cmd-click the layer thumbnail to select the opaque pixels.
- Go to Select → Modify → Contract and enter 1 or 2 pixels.
- Go to Select → Modify → Feather and enter 0.5 pixels to keep the edge soft.
- Click Add layer mask at the bottom of the Layers panel.
The mask hides the outermost ring of pixels, which is where the halo lives. Because it is a mask, you can paint it back with a white brush if you cut too much.
Fix 3: Photopea (free, in the browser)
Photopea works almost exactly like Photoshop and is free to use in a browser.
- Open photopea.com and drag the PNG into the window.
- Use Layer → Matting → Defringe with a value of 1 or 2 pixels.
- Export with File → Export as → PNG. Keep "Transparency" ticked.
Fix 4: GIMP
GIMP does not have a Defringe command, but the mask method works well:
- Right-click the layer and choose Alpha to Selection.
- Go to Select → Shrink, enter 1 pixel.
- Go to Select → Feather, enter 1 pixel.
- Right-click the layer, choose Add Layer Mask, and pick Selection.
- Export with File → Export As, choosing a
.pngfile name.
For white halos specifically, Colors → Color to Alpha with white as the colour can also remove the tint from edge pixels. Use it on a duplicate layer first, because it also affects white areas inside the object.
Fix 5: Canva and Figma (no editing tools)
Canva and Figma cannot change individual edge pixels, but you can still hide a halo:
- Add a subtle shadow or outline. A dark drop shadow at low opacity, or a 1-pixel outline in a colour close to the object, covers a faint fringe. In Canva use Edit → Shadows; in Figma add a Drop shadow effect.
- Use a mid-tone background. Halos are most visible at the extremes. A mid-grey, brand colour or photo background often makes them disappear.
- Scale the image down a little. A one-pixel halo on a 2000-pixel image is invisible when the image is shown at 400 pixels.
If you work in Canva a lot, our step-by-step guide to using transparent PNGs in Canva covers more fixes for white boxes and blurry edges.
Hair, fur and other difficult edges
Fine detail is the hardest case because the edge is mostly semi-transparent pixels. Contracting the selection would cut the hair off. Instead:
- Duplicate the layer.
- On the lower copy, apply Defringe with 2 to 3 pixels.
- On the upper copy, keep the original edges but lower the layer opacity until the halo fades while the hair stays visible.
Alternatively, pick a background close to the original photo's colour. A portrait cut from a light studio background will always look best on light designs.
Prevent halos in your own cut-outs
If you create your own transparent images, you can avoid the problem from the start:
- Remove the background before resizing; resizing blends background colour into the edges.
- Use a background-removal tool that offers edge refinement or decontaminate colours.
- Save as PNG-24 (with full alpha), never PNG-8, which only allows fully transparent or fully opaque pixels.
Our guide to making your own transparent PNG walks through this with free tools.
Quick checklist
- Test the cut-out on a black background.
- In Photoshop or Photopea: Defringe 1–2 px, or Remove White Matte.
- In GIMP: Alpha to Selection → Shrink 1 px → Feather → Layer Mask.
- In Canva or Figma: hide it with a subtle shadow, outline or mid-tone background.
- Export as full PNG with transparency kept.
A clean edge is a small detail, but it is often the difference between a design that looks professional and one that looks assembled.