Published
Lossless does not mean the detail came back
Every page that ranks for this question lines the two formats up on the same three rows: how the compression works, whether transparency is supported, and which one makes the smaller file. All three are accurate, and if you are putting an image on a web page they are also enough to decide with.
They are not enough for the reader who usually arrives here, who has a photograph rather than a design asset. A scan of a print, a picture off a phone, something inherited in an envelope. For that reader the question underneath is which file to keep and which one to hand over, and the comparison table does not answer it, because the row the answer turns on is the one nobody expands.
That row is lossless. PNG is lossless and JPEG is not, which is true and is the beginning of the subject rather than the end of it. What lossless actually promises is narrower than it sounds, and the gap between what it promises and what people take it to promise is where most of the wrong decisions here get made.
The difference everything else follows from
JPEG makes a file small by deciding which parts of the picture you will not miss, and then discarding them. That decision is permanent. Reopening the file does not undo it, because what was discarded is not compressed and waiting, it is gone.
PNG makes a file smaller without discarding anything. Every pixel that goes in comes out identical, which is what lossless means, and the saving comes from describing repetition more efficiently rather than from throwing information away.
The other two rows in every comparison both fall out of that one. PNG carries an alpha channel, so a pixel can be partly or wholly see through, while JPEG has no such channel, so anything transparent is filled in solid the moment you save. And a PNG of a photograph is usually far larger than the JPEG of the same picture, for a reason that has nothing to do with quality and everything to do with what photographs are made of.
- JPEG is lossy. What it stores is an approximation chosen to convince a human eye.
- PNG is lossless. What it stores is the picture you handed it, pixel for pixel.
- Only PNG has transparency. Saving a cut out subject as JPEG puts a solid rectangle behind it.
- Lossless is a property of the save you are making now. It says nothing about the saves that came before it.
A PNG made from a JPEG is a perfect copy of a flawed picture
This is the mistake worth reading the page for, because it gets made constantly and it feels like the careful choice. You have a photograph that matters. You read that PNG is the lossless format and JPEG is the lossy one. So you open the JPEG, save it as a PNG, and consider the picture safe.
It is safe, in the narrow sense that nothing further will be lost. It is also no better than it was a minute earlier, and it cannot become better. The discarding happened when the JPEG was first written. Converting that file to a lossless format preserves the result of the discarding exactly, blocking and smeared edges included if the original was saved hard. You have not rescued the photograph. You have made a faithful and much larger record of its present condition.
Those patterns are worth being able to recognise, since they are the clearest sign you are looking at a picture that has been through compression rather than one that was simply taken badly. The guide on JPEG artifacts covers both of the shapes they take.
Lossless is a promise about a file’s future, never about its past. That sentence settles most of what people are really asking when they ask this question.
- Converting JPEG to PNG recovers nothing. There is nothing left in the file to recover.
- It does stop further loss, which is worth something on a file you are about to edit repeatedly.
- On a photograph you pay a great deal of file size to buy that.
- If the JPEG already carries visible artifacts, the PNG carries exactly the same ones, permanently.
Why PNG is the wrong shape for a photograph
PNG earns its compression from repetition. It looks for runs of identical pixels and for rows that resemble the row above, and it stores the resemblance instead of the pixels. On a screenshot, a logo, a chart or a diagram that works extremely well, because those images are built from flat areas and hard edges, so large regions of the picture genuinely are identical to their neighbours.
A photograph has almost none of that. Every pixel differs slightly from the one beside it through grain, sensor noise, paper texture, the gradient across a sky. There is little for the compressor to describe efficiently, so the file stays close to its uncompressed size. That is how you end up holding a PNG several times the size of the JPEG with no visible difference between the two on screen.
So the rule of thumb every comparison table ends on, photographs as JPEG and graphics as PNG, is not an arbitrary convention anyone could have chosen differently. It follows from what the two compressors are each good at.
One case catches people out. A scan of a handwritten letter or a certificate looks like the text case, and it is not. The scan is a photograph of paper: it carries the grain of the fibre, the unevenness of the ink, the shadow in a fold. It compresses like a photograph rather than like a screenshot, so a lossless save of it is as heavy as a lossless save of a portrait. The guide on restoring old documents covers what else is different about reading those.
- PNG compresses repetition, and screenshots, logos, icons, charts and line art are mostly repetition.
- Photographs are mostly variation, which is why the lossless file barely shrinks.
- A scanned letter is a photograph of paper, not a screenshot, whatever is written on it.
- A large PNG of a photograph is not a higher quality photograph. It is the same picture, stored differently.
Where transparency decides it outright
The one row in the comparison that is decisive rather than nuanced is the alpha channel, and it is decisive in a single direction. If part of your image has to be see through, PNG is the only one of the two that can do it, and there is nothing further to weigh.
On a whole photograph that almost never arises, because a photograph is a filled rectangle. It arises the moment you cut something out of one: a face lifted off its background for a card, an object isolated from the room it was standing in. Save that as a JPEG and the absence becomes a white box, which is the most common way a carefully cut out subject gets ruined at the final step.
The reverse move, saving a photograph as PNG because transparency might be wanted some day, is a cost paid now for an option you will probably never use. Keep the flattened photograph as a JPEG, and make the cut out as a PNG when there is something to use it for.
When PNG is the right file for a photograph after all
There is a real set of cases, and it is narrower than the format’s reputation suggests.
- A working copy you will open, change and save again several times. Each JPEG save re-encodes and the damage compounds; a lossless file in the middle of that chain does not, and you export one JPEG at the end.
- A file that has to be pixel identical to another one, which is what a before and after comparison needs if the comparison is going to mean anything.
- An archive scan, where your scanner offers a lossless option and you have room for it. That is the one save in this whole subject you get to choose from the start, and the scanning guide goes into the rest of that decision.
- A screenshot, a chart, or anything with text in it, where PNG wins on quality and on size at once and the question never really arises.
Which one to keep, which one to send
The practical rule is far shorter than the reasoning behind it, and it is the same rule that governs every other format question on this site. The original, in whatever it was written as, is the archive copy. Converting it cannot improve it, so a conversion either costs you something or costs you nothing, and those are the only two outcomes available.
Send JPEG. Everything opens it, every upload form takes it, and nobody has ever been grateful to receive a photograph as a PNG several times larger with no visible gain. Keep the original, work on copies, and where the work involves many saves, let the copy in the middle be lossless and the file you deliver be a JPEG.
One habit is worth naming because it is so common. A screenshot of a photograph is usually a PNG, and it is an exact copy of what your screen was displaying rather than of the photograph itself: scaled to fit the window, with whatever the viewer did to it baked in. The file is always better to keep than a picture of the file. For the format an iPhone writes instead of JPEG, the HEIC comparison here walks through the same decision.
What this means if you are about to repair the photograph
Most people reading a format comparison about an old picture are on their way somewhere. They want the photograph to look better and they are trying not to damage it on the way, which is a good instinct pointed at the wrong lever.
An enhancement works from what survived in the file. It can rebuild plausible edges where the shape of them is still there, lift a picture that is dim rather than empty, and enlarge a small one so that it holds together. What it cannot do is ask the file for a texture the first compression removed, because nothing in the file implies that texture any more. So the input that decides your ceiling is the least re-encoded copy you can find, and not the format it happens to be sitting in.
Which means the PNG you made this morning out of a JPEG somebody messaged you is not a better starting point than that JPEG. It is the same picture in a larger file. If the original is on an old drive, in a mail attachment from years ago, or still in the camera roll of the phone that took it, that is the file to use, whichever of the two formats it turns out to be.
Once you have found the best copy, the format stops being the interesting question and the photograph starts being one. Clara enlarges a picture and rebuilds detail in it, faces included, and the first enhance is free, so the honest way to learn what a given file still holds is to put your hardest photograph through it rather than your easiest. Saving or sharing a result takes Pro.
If the picture is going on a web page instead
A good share of the people searching this are not holding a family photograph at all, and the short answer is theirs. Photographs go out as JPEG, because the lossy save is the small one and the loss is invisible at the size a page displays. Logos, icons, screenshots, charts and anything carrying text go out as PNG, where the lossless save is also the lighter of the two. Newer formats handle both jobs better, with the familiar cost that something old will refuse to open them.
If what you are holding is a photograph you intend to keep rather than publish, the format is the smaller half of the decision and the copy you start from is the larger half. Keep the original, convert copies, point any repair at the oldest copy you own, and let the enhancement work on the file that has been through the fewest hands.
More guides
Questions
Is PNG better quality than JPEG?
PNG is more faithful, which is not the same thing. It reproduces whatever you give it pixel for pixel, so a PNG of a pristine image stays pristine and a PNG of a battered JPEG stays battered. On a photograph being saved once for normal use, a good JPEG and a PNG look the same and the PNG is far heavier.
Does converting a JPEG to PNG improve it?
No, and it cannot. The detail JPEG discarded was discarded when that file was written, and a lossless format has no way to ask for it back. What the conversion does is freeze the picture in its current state, artifacts and all, in a much larger file. It is useful before a long editing session and useless as a rescue.
Should I save scanned photos as PNG or JPEG?
Either works if you save once and then leave that file alone, which matters more than the choice. Lossless is the better archive copy where your scanner offers it and you have the room, since the scan is the one encode you control from the start. JPEG is the reasonable choice on compatibility grounds, and an archive you can always open has its own kind of value.
Why is my PNG so much bigger than the JPEG of the same photo?
Because PNG compresses by finding repetition and a photograph has very little. Grain, noise, paper texture and gradients mean nearly every pixel differs from its neighbour, so there is not much for the compressor to shorten. The same file format is tiny on a screenshot, where huge areas of the image genuinely are identical.
Does a PNG lose quality when you save it again?
No. Re-saving a PNG rewrites the same pixels, which is why it suits a file you are going to open and change repeatedly. A JPEG re-encodes on every save and each pass treats the previous pass’s damage as detail worth protecting, which is the loss that compounds down a chain of edits and shares.
Which format should I keep a photo in if I want to restore it later?
Whichever one it already is, untouched, because what limits a later repair is how many times the picture has been re-encoded rather than which of the two formats holds it. Find the oldest copy you have before you start, keep it as the archive, and do the repairing and the converting on copies of it.