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



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
Check the file
- Open it against both a light and a dark background.
- Look for a transparency grid or alpha-channel indicator in an editor.
- If the black area is stored in the image, return to the original transparent version when possible.
- 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
- W3C: PNG specification
- Google: WebP container specification