What is a PNG file? Transparency, quality and when to use it
PNG, short for Portable Network Graphics, is a common image format for logos, screenshots, diagrams and any picture that needs sharp edges or a transparent background.
What is a PNG file?
PNG is a lossless format. When you save an image as PNG, every pixel is stored exactly as it was, so nothing is lost no matter how many times you open and re-save the file. It also supports full alpha transparency: each pixel can be fully visible, fully transparent, or anywhere in between. That is why PNG is the usual choice for logos placed on coloured backgrounds.
PNG was created in the mid-1990s as a free, open alternative to GIF, which was held back by licensing rules at the time. It is supported by every modern browser, phone and office app.
How PNG compression works
PNG does not throw any data away. It uses two steps:
- Filtering. Each row of pixels is predicted from its neighbours, and only the small difference is stored. Neighbouring pixels in a photo or a flat-colour graphic are often very similar, so these differences are mostly zeros and small numbers.
- DEFLATE compression. The same method used in ZIP files finds repeated patterns and stores them as short references.
A simple example: the sequence AAAABBCCCC takes 10 bytes. Stored as runs (4 A, 2 B, 4 C), it needs far fewer. Real images have much more structure than this, but the idea is the same.
How big is a PNG?
Because nothing is discarded, PNG files are usually larger than JPEG files of the same photo. This image is 1080×720 pixels. Here is the same picture in each format:
| Format | Preview | File size |
|---|---|---|
| Raw (uncompressed) | 2.33 MB | |
| PNG (lossless) | ![]() | 0.84 MB |
The PNG is about 2.8 times smaller than the raw image. Flat graphics, such as logos and icons with large areas of one colour, compress much better in PNG than photos do, and can be quite small.
Pros of PNG
- Lossless. Text, lines and fine details stay sharp.
- Transparency. Logos and cut-outs sit cleanly on any background.
- Widely supported. It opens everywhere, with no quality setting to worry about.
Cons of PNG
- Large files for photos. A photo saved as PNG can be many times bigger than a JPEG.
- Not ideal for the web. For photos on a website, JPEG or WebP loads much faster.
JPG, PNG or WebP?
Use PNG for logos, screenshots, text-heavy graphics and anything that needs transparency. Use JPG for everyday photos where a small file matters more than perfect detail. WebP is a modern option that supports both transparency and lossy compression, and it is often the smallest of the three.
Want to switch formats? Try the image converter, or the background remover if you need a transparent PNG from a photo. Everything runs in your browser, so your files stay on your device.
Photo by NordWood Themes on Unsplash
