2026-07-25
What actually happens when you convert PNG to JPG (or JPG to PNG)
Converting a PNG to JPG looks like it should be free — same picture, different file extension. It isn't quite that simple. The two formats compress images in fundamentally different ways, and switching between them changes real things: file size, sharp edges, and what happens to any transparent pixels. Here's what actually happens in each direction, and how to avoid losing more than you have to.
Why the two formats behave so differently
JPEG is lossy. It splits the image into 8×8-pixel blocks, converts each block into frequency data, and then throws away some of that data to save space — mostly the fine, high- frequency detail the eye is least likely to notice. That's a one-way trip: once a block's detail is discarded during encoding, no later re-save gets it back.
PNG is lossless. It predicts each pixel from its neighbors, stores the difference, and compresses that with DEFLATE — the same general-purpose algorithm behind ZIP. Every pixel decodes back out exactly as it went in. The cost is a much bigger file: a lossless format simply can't match a lossy one on compression ratio for the same photo.
PNG → JPG: real quality loss, plus a gotcha most people miss
Converting a PNG to JPG at a high quality setting (85–95%) is close to invisible on an ordinary photo — the discarded detail is exactly the kind of fine texture that's hard to see anyway. Push the quality slider low, or start from a screenshot or an image with sharp text and flat color instead of a photo, and it gets visible fast: blocky artifacts and ringing around hard edges, which is where JPEG's DCT math struggles most.
The gotcha isn't quality, though — it's transparency. JPEG has no alpha channel at all, so a converter has to decide what goes where the transparent pixels used to be. In NearIMG's convert-to-JPG path, that's a plain white fill applied before encoding. A logo or sticker PNG with a transparent background doesn't come out faded or approximated — it comes out with a solid white box exactly where the transparency was. That's not a bug to route around; it's just what "JPG has no transparency" concretely means once you actually hit it.
JPG → PNG: why it doesn't get you back what you lost
Going the other way is lossless from that point forward — but only from that point forward. PNG faithfully stores whatever pixels the JPG currently has, blocky artifacts included; it can't reconstruct detail a JPEG encoder already threw away earlier. Converting to PNG doesn't undo a prior JPEG's damage.
People still do this for real reasons that have nothing to do with recovering quality: a downstream tool that only accepts PNG, or needing an alpha channel to layer a transparent watermark or sticker on top of a photo that only exists as a JPG. In both cases PNG is the right container for what happens next, not a quality fix for what already happened.
When the loss actually matters
For an ordinary photo — gradients, natural texture, no sharp graphic edges — JPEG at a decent quality setting is genuinely hard to tell apart from the source, and the file-size win is large. For screenshots, UI mockups, line art, or anything with flat color and crisp text, JPEG's block-based math is a poor fit and the artifacts show up even at fairly high quality settings. And loss compounds: re-saving the same JPEG repeatedly, each time through a lossy encoder, adds a fresh round of quantization on top of the last one. Converting once is very different from round-tripping a file through JPEG five times over a week of edits.
Keeping the damage to a minimum
A few things actually move the needle. Convert once, not repeatedly — decide on a format and stick with it through your edits, then export at the end. Keep the quality setting high (85– 95%) rather than defaulting to whatever's lowest; the file-size difference between 95% and 70% is much smaller than the visible-artifact difference. If you need small file size and transparency together, reach for WebP instead of PNG — it supports an alpha channel like PNG does, but compresses closer to JPEG's size. And if your output format is PNG, know that a quality slider doesn't do anything at all — PNG's compression is lossless by definition, so there's no quality knob to turn; only JPEG and WebP outputs actually respond to it.