Why does a transparent image have a black background?

The viewer may be placing transparent pixels over black, or the export may have replaced transparency with black pixels. These are different cases.

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

Check the file

  1. Open it against both a light and a dark background.
  2. Look for a transparency grid or alpha-channel indicator in an editor.
  3. If the black area is stored in the image, return to the original transparent version when possible.
  4. When exporting to an opaque format, choose the background color explicitly.

A checkerboard can also be baked into a downloaded picture. Seeing a checkerboard does not prove that the file has transparency.

Related guides

Sources