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

Partly transparent blue badge on a checkerboard, with an opaque white center.
PNG on a transparency grid
Download original file
The same badge on white: the blue looks lighter and the white center blends into the background.
Same PNG on white
Download original file
The same badge on dark: the blue looks darker, while the center stays white.
Same PNG on dark
Download original file

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
FileDimensionsBytesExport settings
alpha-source.png450 × 30013,126Optimize: True
alpha-on-white.png450 × 30011,183Optimize: True
alpha-on-dark.png450 × 30010,552Optimize: 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

Sources