How to Save Transparent PNGs Without White Edges
You cut out a logo, saved a transparent PNG, dropped it on a dark background, and there it is: a thin, pale outline tracing every edge. The cut-out is not wrong. What you are seeing is a small number of partially transparent pixels that are still carrying the color of the background you removed. Here is where that comes from and how to get rid of it.
What an alpha channel actually stores
A PNG pixel holds four numbers: red, green, blue, and alpha. Alpha is opacity, from 0 (invisible) to 255 (fully solid). The critical detail is that a pixel keeps its RGB values even when alpha is low. A pixel can be pure white and 90 percent transparent. You will barely see it — until it is composited over something dark, and then that faint white shows up.
Every white-edge problem is a variation of the same thing: edge pixels that are partially transparent and hold the wrong color underneath.

Cause 1: Anti-aliased edges blended against white
Digital images have square pixels; real objects have curved edges. Anti-aliasing bridges the gap by making pixels along an edge a blend of the object and whatever is behind it. A pixel that is 40 percent covered by a red logo on a white page gets stored as a pale pink — 40 percent red mixed with 60 percent white.
Now remove the background. A typical remover clears pixels that closely match the background color and leaves the rest. Your pale pink pixel is not close enough to pure white to be deleted, so it survives at full opacity, still pale pink. Multiply that by every pixel along the outline and you have a one-pixel light border tracing the whole shape.
Better removers do something smarter: instead of a binary keep-or-delete, they set that pixel to 40 percent alpha and try to recover the underlying red. But recovering the true color from a blend is guesswork, and how much of the white it manages to back out determines how clean the edge looks.
Cause 2: The format threw the alpha channel away
JPEG has no alpha channel. None. It is a three-channel format designed for photographs, and there is nowhere in the file to store transparency. When you save a transparent image as JPG, the encoder flattens it against a background — almost always white — and the transparency is gone permanently.
This is where the classic disaster happens. You export a clean PNG, then somewhere downstream something converts it to JPG: a CMS resizing uploads, a chat app compressing attachments, a design tool exporting a preview, an email client. Your transparent background becomes a solid white rectangle, and if you then re-remove the white you are cutting against JPEG-compressed edges, which are far messier than the original.
| Format | Alpha support | Use it for |
|---|---|---|
| PNG | Full 8-bit alpha, lossless | Logos, cut-outs, sprites, UI assets — the safe default |
| WebP | Full alpha, lossy or lossless | Web delivery where file size matters |
| AVIF | Full alpha | Web delivery, smallest files, narrower tool support |
| GIF | 1-bit only (on or off) | Nothing modern — hard edges, 256 colors |
| JPEG | None | Photographs with no transparency |
| SVG | Native (vector) | Logos and icons that exist as vectors |
Note the GIF row. One-bit transparency means each pixel is either fully visible or fully invisible — there is no partial coverage, so anti-aliasing is impossible and every edge is jagged. Converting a smooth PNG to GIF trades a soft halo for a staircase.
Cause 3: Matte fringing
Some editors store transparent images with a "matte" color: the RGB values of fully transparent pixels are set to a chosen color, usually white, on the theory that it does not matter because alpha is zero. Usually it does not. But some renderers, and most image resizing operations, average neighbouring pixels including their RGB values, weighted or not by alpha. A naive resize pulls that white in from the invisible pixels and smears it into the visible edge.
This is why an image can look perfect at full size and grow a halo after being scaled down for a thumbnail. The correct technique is premultiplied alpha, where RGB values are stored already multiplied by alpha so that averaging behaves correctly. Most modern browsers and engines handle this properly; older pipelines and some custom code do not.
Fixes, in order of preference
1. Never introduce the problem
If you control the source, this is by far the best option. Export the artwork from the tool where it was created with a transparent background from the start, rather than exporting it flattened onto white and cutting the white back out afterwards. Vector tools, 3D renderers, and design apps all support alpha export. Every removal step is a step that can go wrong.
If you are generating images with an AI model, ask for a transparent background explicitly, or ask for a background color that appears nowhere in the subject. Bright magenta is the traditional choice: nothing natural is that color, so separating it is unambiguous.
2. Remove the background against a contrasting color
The white halo exists because the background was white. If the subject sits on magenta or neon green instead, the leftover edge pixels are magenta or green — which is arguably worse-looking but far easier for a tool to detect and correct, precisely because those colors are so far from anything in the subject.
Our Background Remover works by sampling the corner pixels to identify the background color and clearing pixels that match it, then exporting a transparent PNG. It handles flat, solid backgrounds well — product shots on white, logos on a single color, graphics exported from a tool. It is not designed for photos with busy or gradient backgrounds, where a subject-segmentation approach is the right tool instead.
3. Contract the alpha by one pixel
If a halo is already baked in, the bluntest reliable fix is to shrink the visible area slightly so the contaminated ring falls outside it. In an editor: load the alpha channel as a selection, contract it by one pixel, invert, and delete. In Photoshop terms that is Layer → Matting → Defringe, which does roughly this automatically; GIMP has Layer → Transparency → Threshold Alpha and the Script-Fu remove-antialiasing options.
The trade-off is real: you are deleting a pixel of genuine edge detail. On a 2000 pixel logo, nobody will ever notice. On a 32 pixel icon, one pixel is three percent of the width and the shape will visibly thin out. Scale the fix to the image.
4. Recolor the edge instead of deleting it
Better for small images. Rather than removing the semi-transparent ring, replace its RGB with the color it should have been — the color of the adjacent interior pixels — while keeping the alpha as is. The edge keeps its softness and its shape; only the contamination goes. Photoshop's Defringe with a small radius approximates this, and it is straightforward to implement directly if you are working in code with canvas image data.
5. Composite against the destination color
Sometimes the honest answer is that you do not need transparency. If the logo will only ever appear on one known background, flatten it onto that exact color and ship a plain image. No alpha, no halo, no format risk. This is not a workaround so much as recognizing that transparency is only worth its complications when the background genuinely varies.
Checking your work
Before you call a cut-out finished, run through this list. It takes a minute and catches nearly everything.
- View it on black and on white. Any halo will be obvious against one of the two. Checkerboard previews in editors are deceptive because mid-grey hides both light and dark fringes.
- View it at 100 percent and scaled down. A halo that appears only when scaled points at matte fringing in the resize step, not at the file.
- Confirm the file is really a PNG or WebP. Check the extension and the actual bytes, not just what the CMS says. A file named logo.png that has been through a JPEG pipeline is a common and confusing failure.
- Test in the real destination. Browsers, game engines, and print pipelines composite differently. The only test that counts is the one where the image will actually be used.
- Check for a stray full-canvas layer. A near-invisible background layer at 1 percent opacity will not show in the editor but will produce a faint wash in the export.
Frequently asked questions
Why does my PNG look fine in the editor but has a white edge on my website?
Two likely reasons. Either the editor was previewing over a light checkerboard that hid a light fringe, or something in your build or CMS pipeline resized or re-encoded the file. Download the exact file the browser is loading and open that one over a black background — not your local original.
Is WebP as safe as PNG for transparency?
For browser use, yes — WebP supports a full alpha channel and is supported everywhere current. Lossy WebP can introduce artifacts near hard edges, so use lossless WebP or PNG for logos and pixel art. Outside browsers, tool support is less universal than PNG, so PNG remains the safer archival format.
Can I recover transparency from a JPG that used to have it?
Not properly. The alpha data is gone from the file, so anything you do is re-cutting against a flattened image whose edges also carry JPEG compression artifacts. You can get a passable result on a simple shape against a clean background, but if the original transparent file exists anywhere, going back to it is always worth the effort.
Should I ever use JPG for an image with transparency?
No. JPEG cannot store transparency, so exporting to it silently flattens the image against a background color. If you need JPEG-level file sizes on an image with alpha, use lossy WebP or AVIF instead — both compress comparably and keep the alpha channel.
Try the Background Remover
Drop in an image with a solid-color background and export a transparent PNG. Corner-pixel detection, PNG output, and everything processed locally in your browser — the image is never uploaded.
Open Background Remover