PNG to JPG: what happens to transparency?
JPG cannot store transparency. Converting a transparent PNG to JPG fills the transparent areas with a solid color, usually white.
What transparency actually stores
A PNG image can store an alpha channel alongside its color information. The alpha channel gives every pixel an opacity value: fully opaque, fully transparent, or partially transparent at any level in between. That partial transparency is what lets a soft shadow fade smoothly into nothing and what lets a logo sit cleanly on any background.
Transparency is not a color. It is the absence of a decision about color, recorded as an instruction to show whatever is behind. For that instruction to survive, the file format has to be able to store it.
JPG has no alpha channel
The JPG format stores only color information, not transparency. Every pixel in a JPG must have a real color value, so the format literally has nowhere to record that a pixel should be see-through.
When a PNG with transparent areas is converted to JPG, the converter has to fill those transparent pixels with a solid background color. The default is white, because it is the safest choice for documents, forms, and most photographs.
The result is technically a correct JPG. What has changed is that every transparent pixel now carries a visible color, and that color becomes part of the image forever.
What happens to partially transparent pixels
Fully transparent pixels simply take the fill color. Partially transparent pixels are blended, or matted, onto the fill color. A soft shadow that was 50 percent transparent becomes a semi-light gray when matted onto white, and a different, darker gray when matted onto black.
This is why the same logo converted to JPG twice with different fill colors can look noticeably different. The fill color does not just appear in empty space; it silently mixes into every semi-transparent edge.
When the fill color matters
A logo with rounded corners and a transparent background will get white corners in JPG. On a dark website those white corners will be visible, and a soft shadow converted to white will look like a pale halo. Keep the PNG version for those situations.
For photographs the transparent areas are usually invisible anyway, which is why photo-to-JPG conversion is so common. A portrait with no transparency converts to JPG with no downside at all.
Fixing halos and jagged edges
If a converted JPG shows a bright fringe around a logo or a cut-out subject, the cause is almost always matting onto the wrong color. The fix is to flatten the PNG onto the background color it will actually sit on before converting, not after.
Flattening means compositing the transparent image onto a solid color permanently, so the semi-transparent edges blend into that color naturally. Flatten onto dark gray for a dark page, and the edges will look intentional instead of accidental.
Keeping transparency instead of losing it
If the image needs transparency, do not convert it to JPG. Keep it as PNG, or encode it as WEBP, which supports both transparency and lossy compression while producing a much smaller file than PNG.
For web use, a lossy WEBP with an alpha channel is often the best of both worlds: small file size, transparent background, and support in all modern browsers. Convert to JPG only when you control the background and file size matters more than transparency.
Check before you replace the original
Compare the converted JPG against the PNG at full size. Look at the edges where transparency used to be, confirm the fill color matches the destination, and check that soft shadows do not look like rectangles.
Keep the PNG as the master file whenever you may need transparency again. Once transparency is flattened into a JPG, no conversion can bring it back — the information is gone.