PNG vs GIF
Use PNG for still images and GIF only when it has to move. PNG keeps millions of colours and smooth transparency; GIF is limited to 256 colours and hard-edged transparency, and its limits are only worth it for an animation that must play everywhere.
Last updated
Choose PNG when
- Logos, icons, screenshots and diagrams.
- Anything with soft or semi-transparent edges, such as a drop shadow.
- Any image with more than 256 colours, which is almost every photo.
Choose GIF when
- A short animation that has to play everywhere, email included.
- A reaction or meme in a chat that expects a GIF.
- Tiny pixel art with a handful of colours.
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 GIF actually is
GIF holds at most 256 colours chosen per image, and it can hold several frames with delays between them, which is why it became the format for short looping animation. Its transparency is a single colour switched on or off, with no partial values, so edges against a coloured background look ragged.
A ten-second GIF is often larger than the MP4 it came from and looks considerably worse. The 256 colour limit, not the length, is what does the damage.
PNG and GIF side by side
| PNG | GIF | |
|---|---|---|
| Extension | .png | .gif |
| Media type | image/png | image/gif |
| Compression | Lossless | Lossless, after palette reduction |
| Transparency | Yes | Yes |
| Animation | No | Yes |
| Quality setting | Not applicable | Not applicable |
| We can write it | Yes | Yes |
Questions
Is PNG better quality than GIF?
For still images, yes. GIF can show only 256 colours at once, so photos and gradients band visibly; PNG has no such limit and loses nothing.
Can a PNG be animated?
An animated PNG (APNG) can, and every current browser plays it, but most chat apps and email clients do not. GIF still wins on reach.
Why is my GIF so big?
GIF compresses poorly, especially video turned into a GIF. An MP4 or animated WEBP of the same clip is often a tenth of the size.