PNG vs JPG
Use JPG for photographs and PNG for anything with text, lines or transparency in it. A photo saved as PNG is several times larger for no visible gain; a screenshot saved as JPG grows fuzzy edges around every letter.
Last updated
Choose PNG when
- Screenshots, especially of text or code.
- Logos, icons, diagrams and anything with hard edges.
- Anything that needs a transparent background.
- An image you will edit and re-save repeatedly, because nothing degrades.
Choose JPG when
- Photographs, and anything with smooth gradients of colour.
- Pictures going somewhere with a size limit — email, a CMS, a form.
- Anywhere maximum compatibility matters; everything opens a JPG.
What PNG actually is
PNG stores every pixel exactly as it was, using a compression method that throws nothing away. It carries a full alpha channel, so a pixel can be any degree of transparent rather than simply on or off, and it handles up to 16 bits per colour channel.
People save photographs as PNG and wonder why an email bounces. A photo that is 400 KB as a JPG is routinely 4 MB as a PNG, because lossless compression cannot do much with the noise in a real photograph.
What JPG actually is
JPG discards detail your eye is least likely to notice, then compresses what is left. The quality setting decides how much it discards. It is the reason photographs on the web are measured in hundreds of kilobytes rather than tens of megabytes.
Re-saving a JPG repeatedly degrades it every time, because it re-encodes from the already damaged version. Edit from the original, and export to JPG once at the end.
PNG and JPG side by side
| PNG | JPG | |
|---|---|---|
| Extension | .png | .jpg |
| Media type | image/png | image/jpeg |
| Compression | Lossless | Lossy |
| Transparency | Yes | No |
| Animation | No | No |
| Quality setting | Not applicable | Yes |
| We can write it | Yes | Yes |
Questions
Does converting JPG to PNG improve the quality?
No, and it usually triples the file size. JPG discards detail when it saves, and nothing can put it back — a PNG made from a JPG is a lossless copy of an image that has already lost something. Convert to PNG when you need transparency or are about to edit, not to repair.
Why is my PNG screenshot so much smaller than my PNG photo?
PNG compresses by finding runs of identical pixels. A screenshot is mostly flat colour, so it packs down enormously. A photograph has almost no two identical neighbouring pixels, so there is nothing to pack.
Which one should I upload to a website?
JPG or WEBP for photographs, PNG for interface graphics. If the site accepts WEBP, it beats both on size at the same quality.