When to keep the PNG
Three tests you can run by looking. None of them needs a tool, and two of them take about ten seconds.
Test one: is it a picture of a screen?
Screenshots, diagrams, charts, logos and anything with type in it are flat areas separated by hard edges. PNG compresses that by noticing that rows repeat, and it does it without discarding anything. JPEG describes the same picture as frequency coefficients, and a hard edge needs the high-frequency ones, which are the first thing the quantiser rounds away. So the edges soften and the file often grows at the same time.
If the image came off a screen rather than out of a camera, start from the assumption that the PNG wins.
Test two: how much of the frame is empty?
Open the PNG on a page whose colour you can change. If most of the frame is the page showing through, the transparency is carrying real information: the shape of the artwork against whatever it is placed on. Converting it fixes that shape against one colour forever, and the file becomes usable in one place instead of anywhere.
The threshold is not a number. A drop shadow is five percent of the frame and is entirely the point; a thin border around a photograph is thirty percent and does not matter.
Test three: what does the arithmetic say?
This is the one that needs a tool, and it is what the converter on this site does before it lets you press anything: it encodes the JPG at full resolution, measures it, and compares. Not an estimate — an encode. If the JPG is not smaller, the line above the button says to keep the PNG, and the button still works, because there are reasons to convert a file that have nothing to do with its size.
Cases where the PNG is the right file
- Anything with type in it that somebody has to read at full size.
- A logo or an icon that is going to be placed on more than one background.
- A chart or a diagram with thin coloured lines. Reduced colour sampling is hardest on exactly those.
- A palette PNG with few colours. It is already about as small as it can be, and the format was chosen correctly the first time.
- Anything you are going to edit again later. Each JPEG pass costs a little and none of it comes back.
Cases where the JPG is the right file
- 1A photograph saved as PNG by mistake. This is the biggest single win available: the file usually drops by an order of magnitude and nothing visible is lost.
- 2A form or a portal that takes JPG and nothing else. The decision has been made for you; make the matte decision well instead.
- 3Anything going somewhere old. JPEG is the format every library on every server can open, which is why forms ask for it.
Three questions
- Is JPG not always smaller than PNG?
- No. JPEG wins on continuous tone and loses on flat colour with hard edges. A screenshot of a spreadsheet is the second kind, and it is common for the JPG to be larger than the PNG it came from as well as worse to look at.
- The upload form only takes JPG. Does any of this matter?
- Then convert, and know what it costs. This note is for the times you have a choice, not for the times a form has made it for you.
- Does converting twice make it worse?
- Yes, and it is worth avoiding. Each JPEG encode quantises the frequency coefficients again, and the second pass throws away detail the first pass had already reduced. Convert from the PNG every time rather than from a JPG you made earlier.