The White Box Problem: What PNG Transparency Becomes in a JPG
The logo looked perfect in Photoshop. Transparent background, crisp edges, exactly what the client wanted for their website header. Then the designer exported it as a JPG for the client's email and something went wrong. Where the transparent background should have been, there was a white rectangle. The client sent back a confused reply: "There's a white box around the logo."
This scenario plays out thousands of times every day, and it traces back to a single misunderstanding about what JPEG is and what it cannot do. The format was never designed for graphics work. It was designed for photographs, and that origin shapes everything it can and cannot store.
Why JPEG Cannot Hold Transparency
The Joint Photographic Experts Group committee formed in 1986 and spent six years developing what became the JPEG standard, finalized in 1992. The format encodes color using YCbCr, a system that separates brightness from color information, and applies lossy compression via the Discrete Cosine Transform, a mathematical technique first described by Nasir Ahmed in 1972 that converts image blocks into frequency components and discards the high-frequency detail the human eye barely notices. The result is remarkable efficiency for images with continuous tonal variation, the kind you get in photographs of faces, landscapes, and objects. JPEG has no concept of transparency. The format stores three channels: luminance, and two chrominance channels. There is no fourth channel for alpha information.
PNG, designed in 1996 as a patent-free replacement for GIF, was built with transparency from the start. It supports full 8-bit alpha channels, meaning each pixel can carry 256 levels of transparency, from fully opaque to fully invisible. PNG uses lossless DEFLATE compression, which means every pixel value is preserved exactly. That transparency data lives in the alpha channel and PNG readers know how to interpret it.
What Your Converter Does Instead
When you convert a PNG with transparency to JPG, the converter must make a decision you never got to make. It sees pixels with alpha values and must assign them a color, because the output format has nowhere to put transparency information. Most converters default to white. Some use black. Some let you configure it. But none of them can carry the transparency itself into the output file because JPEG has no mechanism for it.
The actual conversion process works like this: the PNG's RGBA data (red, green, blue, alpha) gets flattened onto a background color. Each transparent or semi-transparent pixel is composited against that background before the JPEG encoder ever sees the data. The encoder then applies its DCT compression to the resulting RGB image. This is why you get that white (or sometimes black) rectangle: it is the background color showing through where your transparency used to be.
There is a second issue that catches people off guard. Converting a lossless PNG to JPEG does not simply apply compression to the original data. The JPEG encoder starts fresh, performing its lossy transform on whatever pixels it receives. The quality of the output depends entirely on the compression setting chosen at export time, not on any prior compression history. This matters because people often assume converting from an "uncompressed" PNG should produce a higher-quality JPEG. It does, but only if you set the JPEG quality high enough. Export at the default quality setting of many tools, typically around 75 percent, and you will see visible compression artifacts in sharp edges and text that were perfectly clean in the original PNG.
When PNG-to-JPG Conversion Actually Makes Sense
The decision tree for PNG-to-JPG conversion is simple once you understand the format constraints. If your PNG has transparency and you need that transparency preserved, you cannot use JPG. Choose WebP, which supports both lossy compression and alpha channels, or keep it as PNG. If your PNG has transparency but you are placing it on a known background color, you can convert safely, as long as you set the background color in your converter to match exactly. If your PNG has no transparency, JPEG conversion is appropriate and will likely reduce the file size substantially. A photographic PNG of a few megabytes often compresses to a JPEG under 200 kilobytes at quality 85 without perceptible quality loss.
The file size difference comes from the nature of the content. PNG's lossless compression performs well on images with large areas of uniform color: logos, diagrams, screenshots of text. It performs poorly on photographs because photographic noise means almost no two adjacent pixels are identical, so there is little for the compression algorithm to exploit. JPEG's lossy approach removes high-frequency detail the human eye barely notices, which is why photos compress so efficiently but text and sharp lines blur slightly at the edges.
A practical rule: use PNG for anything that needs transparency, uses text, or has flat graphic elements with sharp edges. Use JPEG for photographs destined for display or web delivery where file size matters. Use WebP when you need the benefits of both.
Conclusion
The designer in the opening scenario eventually fixed the issue by converting to PNG for the website header and sending a separate JPG version with a white background explicitly composited in. Both files did their job. The problem was not the conversion itself. It was assuming that JPG could carry information it was never built to hold.
The PNG to JPG converter at ToolHQ processes your image server-side. Set the quality level between 1 and 100, convert, and download the result. For photographic content without transparency, a quality setting of 85 is a practical starting point that balances file size and visual fidelity for most web uses.
Frequently Asked Questions
What happens to transparent pixels when I convert PNG to JPG?
They get composited onto a solid background color, usually white. JPEG has no alpha channel, so transparency information is permanently lost during conversion.
Does converting a PNG to JPG lose quality?
Yes. JPEG applies lossy compression regardless of the source. The quality depends on your export settings, not the PNG's lossless origin.
Can I convert a PNG logo to JPG without getting a white box?
Only if you explicitly set the background color in your converter to match the destination background. Otherwise the white box will appear wherever the logo was transparent.
What format should I use for images with transparency?
PNG preserves transparency losslessly. WebP supports transparency with smaller file sizes. JPG cannot hold transparency at all.
Try These Free Tools
PNG to WebP Converter
Convert PNG to WebP format for smaller file sizes with transparency support. Fast and free.
Image Compressor
Compress JPG, PNG and WebP images online without losing visible quality. Reduce file size up to 90%.
WebP to PNG Converter
Convert WebP images to PNG format with full transparency support. 100% browser-based and free.