What is a PNG file?
PNG is a raster format with lossless compression and support for transparency. It works well for screenshots, diagrams and graphics with sharp edges.
Transparency on different backgrounds



The grid marks transparent areas; it is not part of the PNG. The blue shape is partly transparent, so its color changes with the background. The white center is opaque and stays white.
Settings and measurements
| File | Dimensions | Bytes | Export settings |
|---|---|---|---|
| alpha-source.png | 450 × 300 | 13,126 | Optimize: True |
| alpha-on-white.png | 450 × 300 | 11,183 | Optimize: True |
| alpha-on-dark.png | 450 × 300 | 10,552 | Optimize: True |
Python 3.14.4, Pillow 13.0.0, Platform Linux, Webp 1.6.0, Jpeg 6.2, Avif 1.4.2
Lossless does not mean untouched
Lossless compression preserves the pixel values that reach the encoder. An editor can still resize the picture, change its colors or reduce the palette before saving it.
When the file is large
For a large photo, try a JPEG or WebP copy and compare its size and appearance. Keep PNG if you need lossless pixels or the app requires it.
Animated PNG
An animated PNG uses the APNG extensions. A .png filename alone does not prove that a file contains only one frame.
Related guides
- JPEG or PNG: which should you use?
- Which format should you use for screenshots?
- Why does a transparent image have a black background?
Sources
- W3C: PNG specification