PDFMove
Where Does Transparency Go When You Convert PNG to JPG?
Guide

Where Does Transparency Go When You Convert PNG to JPG?

5 min read

What is lost is not a setting, it is a channel

Converting a PNG with a transparent background to JPG and being met with a white rectangle is the most frequently surprising outcome in online image conversion. People usually assume it is a settings error and start hunting for the correct option. But what is lost here is not a setting — it is a data layer the format never had in the first place.

In this article we explain what the alpha channel is, why JPG does not have one, and exactly what happens to transparent pixels at the moment of conversion.

What is the alpha channel?

In a digital image, every pixel carries color information. In the common representation, this information consists of three channels: red, green and blue. PNG adds a fourth channel to those three: alpha. The alpha channel stores not color but how opaque that pixel is.

The alpha value can take 256 different levels. At one extreme the pixel is completely invisible and the surface behind it shows through untouched. At the other extreme the pixel is completely opaque and reveals nothing behind it. The values in between express partial transparency, and in practice those are the most critical ones: the soft transition along a logo's curved edge, the shadow beneath an object, the blurred backdrop of a glass effect — all of these work through intermediate alpha values.

This is why PNG's transparency is not a simple "on or off" binary. That is precisely where it departs from GIF's binary transparency, which can only choose between fully transparent and fully opaque.

Why is there no alpha channel in JPG?

JPG was designed to store photographs efficiently. A photograph does not have a background; the entire rectangular frame is filled. So a need like transparency never arose in the format's design. There is no field defined in the JPG file structure to hold an alpha channel.

This is not a software shortcoming or a feature that was disabled later — it is a design decision baked into the format itself. No converter and no setting can change it. There is no such option as "convert to JPG while preserving transparency," and there cannot be.

What exactly happens at the moment of conversion?

The converter opens the PNG and obtains a four-channel pixel array. To save it as a JPG, it has to reduce that array to three channels. Simply dropping the alpha channel would leave transparent pixels in arbitrary colors, so what actually happens is a blending operation called flattening.

During flattening, the software picks a fill color and mixes each pixel with that color according to its own alpha value. A fully transparent pixel becomes the fill color itself. A semi-transparent pixel becomes a weighted average of its own color and the fill color. Fully opaque pixels stay unchanged.

What the fill color will be is not written into the format; it is the software's choice. The vast majority of image editors and online tools use white. Some image processing libraries represent transparent regions with a zero value and therefore produce a black fill. That is why it is perfectly normal to run the same file through two different tools and get different background colors.

Where does it hurt the most?

On soft-edged logos. A logo's curved edges look smooth thanks to anti-aliasing, and that anti-aliasing is done with semi-transparent pixels. After a white fill, the logo may still look fine on a white background, but put it on a dark surface and a light-colored halo appears around the edges.

On shadowed graphics. Soft shadows designed to look natural get blended with the fill color and can no longer adapt to the surface beneath them. The shadow becomes a fixed stain, independent of the background.

On product images with the background removed. The background removed for e-commerce comes right back the moment you convert to JPG — this time as a white rectangle. All flexibility to show the product on different backgrounds is gone.

Why can't it be undone?

The loss happens not in the file format but in the image itself. After the conversion, the white area is no longer a region marked as "this used to be transparent"; it is a real, ordinary part of the image. When you convert the file back to PNG, you store that white area losslessly just like every other pixel.

The only way to regain transparency is to remove the background again. On a flat, single-color fill this is relatively easy, but because soft edges and shadows were blended in, the result never comes out as clean as the original.

What is the right approach?

Never delete the source PNG; always produce a new file when you convert PNG to JPG. If you still need transparency, JPG should not be your target format: WEBP supports the alpha channel in both lossy and lossless mode and usually yields a noticeably smaller file than PNG. And if the image's background is a known, fixed color in every circumstance, deliberately choosing that color as the fill is a legitimate solution too — in that case you suffer no loss, you simply give up flexibility.

In summary

When you convert to JPG, transparency does not go anywhere — it simply cannot be stored. Because the alpha channel is not defined in JPG's file structure, transparent and semi-transparent pixels get blended with a fill color and become a permanent part of the image. Whether that fill is white or black is the tool's choice. The question to ask before deciding is this: will this image's background ever have to sit on a different surface? If the answer is yes, JPG is not the right target.

Frequently Asked Questions

Why is the background sometimes white and sometimes black?

Because transparency information cannot be stored in a JPG, the converter has to fill the transparent pixels with some color, and which color it picks is a decision made by the software, not by the format. Most online tools and image editors use white, because most document and web backgrounds are white. Some libraries, on the other hand, represent transparent pixels with a zero value, so the result comes out black. That is why it is not surprising to convert the same file with two different tools and get two different results.

What happens to semi-transparent pixels during conversion?

Semi-transparent pixels get blended with the fill color; a shadow that is fifty percent transparent gray turns into a light gray tone over a white fill and no longer carries any transparency information. This is the most conspicuous problem with shadowed logos and soft-edged graphics, because the edges of the image no longer merge into the background — they appear as a white halo. Place it on a dark background and that halo is immediately obvious. Every image with anti-aliasing carries this effect to some degree.

Is there a way to preserve transparency before converting?

Not when converting to JPG, because the format defines no alpha channel. If you want to keep transparency and still shrink the file, the right target is WEBP; it supports transparency in both lossy and lossless mode and is usually noticeably smaller than PNG. Alternatively, you can stay on PNG and reduce the image's pixel dimensions to the size you actually need. And if the image's final background is a fixed, known color under all circumstances, deliberately using that color as the fill is an acceptable solution too.

If I convert the JPG back to PNG, does transparency come back?

It does not. A format conversion only changes how the data is packed; it does not regenerate deleted information. In the JPG, every pixel is now opaque and the fill color has become a genuine part of the image; when you convert to PNG, that white area is stored losslessly along with everything else. To get transparency back you have to remove the background again — that is, run a separate background removal operation.

Try this out right away with PNG → JPG Dönüştür.

Try PNG → JPG Dönüştür