1. Home
  2. Guides
  3. Why a transparent PNG turns black as a JPG

PNG · Image formats

Why a transparent PNG turns black as a JPG

JPEG has no alpha channel, so it has no way to record that a pixel is transparent. When a PNG with transparency is converted to JPG, every transparent pixel must be given a colour, and the default in most software is black — not out of malice but because an empty image buffer is filled with zeroes, and zero in every colour channel is black. Converting to PNG or WebP instead keeps the transparency intact, since both formats support a full alpha channel. If you genuinely need a JPG, the fix is to composite the image onto a chosen background colour first, which the converters here do onto white.

JPEG cannot store transparency at all

This is a limitation of the format rather than of any particular tool. A JPEG stores three colour channels per pixel and nothing else. There is no fourth channel and no mechanism for one, and there never has been — the format was standardised in 1992 for photographs, and photographs do not have transparent regions.

PNG, by contrast, was designed with an alpha channel from the start, which is why it became the standard for logos, icons and anything that needs to sit on top of a background. WebP and AVIF both support alpha too.

So the conversion is not losing your transparency through carelessness. It is being asked to store something in a container that has no room for it, and something has to give.

Need to convert the file?

PNG to JPG

Why black specifically

The answer is more mundane than it looks. Image processing generally starts with a blank buffer, and a blank buffer is zeroes. In RGBA terms that is red zero, green zero, blue zero, alpha zero — fully transparent black. While the alpha channel exists, the colour underneath does not matter, because nothing transparent is drawn.

The moment the image is encoded to a format with no alpha channel, that channel is simply dropped. The colour values that were sitting underneath, ignored and unexamined, are suddenly what gets written. They were zero, so the result is black.

This is why the black is so consistent across completely unrelated software. Nobody chose it. It is what falls out of the arithmetic when transparency is discarded rather than resolved.

The halo nobody warns you about

Flattening onto white instead of black solves the obvious problem and introduces a subtler one, which is worth understanding before you wonder why a logo looks slightly wrong.

Transparency is not binary. The edges of any shape drawn with anti-aliasing are semi-transparent — a pixel at the boundary of a circle might be 40 per cent opaque, blending smoothly into whatever is behind it. That is what makes the edge look smooth rather than jagged.

When you flatten onto white, those partially transparent edge pixels blend with white. Place the resulting JPG on a white page and it looks perfect. Place it on a dark page and every edge carries a faint white fringe, because the blending has been baked in. Flattening onto black produces the same artefact in reverse.

There is no way around this within JPEG. The only real fix is to flatten onto the colour the image will actually sit on, or to keep a format that has an alpha channel.

What to convert to instead

If the transparency matters, do not convert to JPG. PNG to PNG obviously preserves it. PNG to WebP preserves it too, and typically produces a file around 25 per cent smaller, which makes WebP the better choice for a logo going onto a website.

A useful sanity check: if you are converting a logo, icon, sticker or diagram, you almost certainly want to keep the alpha channel and JPG is the wrong destination. If you are converting a photograph, there is no transparency to lose and JPG is usually right.

When flattening is the correct answer

Sometimes JPG is genuinely required — an upload form that accepts nothing else, a print service, or a system that rejects PNG on file size. In that case flattening is not a compromise but the actual goal, and the only question is which colour to flatten onto.

White is right most of the time, because the destinations that demand JPG are overwhelmingly documents and forms rendered on white. That is why the converters on this site composite onto white rather than leaving the buffer at its default. It is a deliberate choice made because the alternative produces a black rectangle that looks broken.

If the image will sit on a coloured background you control, and the edges matter, the better route is to composite it onto that colour in an editor before converting, so the anti-aliased edges blend with the right thing.

Frequently asked questions

Why does my transparent PNG have a black background as a JPG?

Because JPEG has no alpha channel, so the transparency has to be replaced with a colour. Most software drops the alpha channel and writes whatever colour values were underneath, which are usually zero — black.

How do I convert a PNG to JPG without a black background?

Use a converter that composites onto white before encoding, which is what the ones here do. If you need a specific background colour, flatten the image onto that colour in an editor first, then convert.

Which formats keep transparency?

PNG, WebP, AVIF, GIF and SVG all support transparency, though GIF only supports a single fully transparent colour rather than a smooth alpha channel. JPEG supports none at all.

Why does my logo have a white outline on a dark background?

Because it was flattened onto white. The anti-aliased edge pixels were semi-transparent and got blended with white permanently, so they now carry a pale fringe that is visible against anything darker. Convert from the original PNG instead.

Is PNG to WebP better than PNG to JPG for a logo?

Considerably, if it is going on a website. WebP keeps the alpha channel intact and is typically around 25 per cent smaller than the PNG, so you lose nothing and gain speed. JPG discards the transparency entirely.

Can I get the transparency back after converting to JPG?

No. The information is gone — those pixels now hold an actual colour rather than a record of being transparent. You have to go back to the original PNG. Automated background removal guesses at it, which is a different operation with a different result.