PNG libraries

Benson Muite
2026-03-10T05:26:03Z

At present hashes of png files are required to match. The png format is a compressed image format and so can have multiple compressed representations that give the same image. Images processed by fdroid server use the highest compressed version possible with libpng and zlib and remove any metadata available as comments or icc prociles.

The system zlib library is often used by png libraries. Zlib-ng-compat provides an alternative to zlib. Png files can also use the miniz implementation. Would it be worth migrating from the Pillow png to another one which does not depend on zlib? Some options include:

- https://lodev.org/lodepng/ (would need to add Python bindings)
- https://libspng.org/ (there are some Python bindings, but they would need some fixes)
- https://github.com/richgel999/miniz (there are Python bindings, but would need fixes)

[PyPNG](https://gitlab.com/drj11/pypng/) is nice, but uses system zlib as Python uses system zlib.