Transparency guide

PNG transparency explained: alpha, halos and fixes

Updated 6 min read OptimizePNG team

Transparency is the main reason people choose PNG over JPG.

It lets a logo sit on any background without a white box around it.

Here is how it works under the hood - and how to fix it when it goes wrong.

What transparency means in an image

Every pixel normally has a color. A transparent pixel has a color plus a note saying how much of whatever sits behind it should show through.

Image editors show that "see-through" area as a grey-and-white checkerboard. The checkerboard is only a display aid - it is not part of the file.

The alpha channel

Besides red, green and blue, a PNG can store a fourth value per pixel: alpha. In an 8-bit channel, alpha runs from 0 (fully transparent) to 255 (fully opaque).

Everything in between is partial transparency. That is what makes soft shadows, glass effects and smooth anti-aliased edges possible.

FormatTransparencyLevels
PNG (RGBA, 32-bit)Full alpha256 per pixel
PNG-8 (indexed)Alpha per palette colorUp to 256
WebPFull alpha256 per pixel
GIFOn or off only2
JPGNone-

How PNG stores transparency

PNG has two ways to do it. Full-color and grayscale images can carry a real alpha channel next to their color channels - that is the "32-bit PNG" you see in export dialogs.

Indexed (8-bit) PNGs use a small extra chunk called tRNS. It assigns an alpha value to each palette color, which keeps files tiny while still allowing soft edges.

Want to see which one your file uses? Drop it into the PNG Metadata Viewer and look for the color type and a tRNS chunk. Bit depth is covered in PNG bit depth explained.

Semi-transparent edges (anti-aliasing)

A round logo drawn only with fully opaque and fully transparent pixels would look jagged. Smooth outlines use a ring of partly transparent pixels instead.

Those edge pixels are why transparency quality matters. Keep them and your logo looks crisp on any background; flatten them and you get stair-steps or halos.

Common transparency problems and fixes

White or dark halo around the edges

The image was exported on a white (or black) background, so the soft edge pixels contain a bit of that color. Re-export on a transparent canvas, or clean it up with Make PNG Transparent and 1-2 steps of edge smoothing.

Black background on phones or in some apps

Some viewers and iOS home-screen icons do not support transparency and fill it with black. The fix is a solid background for that specific use - for example the Apple touch icon made by our Favicon Generator.

A "transparent" PNG with a checkerboard baked in

Images grabbed from previews often have the checkerboard painted into the pixels. Nothing is actually transparent. Make PNG Transparent can often strip the pattern: pick the white squares and raise Tolerance until the light grey ones go too. If your design contains similar light colors, tracking down the original file is the cleaner fix.

Transparency disappears after converting

JPG cannot store transparency, so converting to JPG fills it with a solid color. Convert to WebP instead if you need a smaller file that stays transparent.

Make or remove transparency

Frequently Asked Questions

The edge pixels were blended with a background color when the image was exported. On a different background that leftover color shows as a halo. Re-export on a transparent canvas, or remove the fringe with Make PNG Transparent using a little edge smoothing.

Some apps, older viewers and iOS home screens ignore or flatten transparency and fill it with black. The PNG itself is fine. If you need a solid background for that place, add one with Add Background to PNG.

The checkerboard was painted into the pixels - often the case with images from stock or search previews. It is not real transparency. Remove it with Make PNG Transparent or find the original file.

No. PNG optimization, resizing, cropping and 8-bit conversion all keep the alpha channel. Only converting to JPG removes it, because JPG cannot store transparency.