A small PNG decoder/encoder lib extracted from my game engine, Lunacy.
A small PNG decoder/encoder lib extracted from my game engine, Lunacy. It was designed for minimal state overhead and to exclusively use read/write callbacks to make it easier to use PNG data from various sources.
See example.c
LuPng uses the zlib API for compression and decompression. For convenience this repo also contains miniz, a public domain implementation of the deflate algorithm that exposes the zlib API. However if your project already uses zlib you can tell LuPng to use that instead.
With zlib:
cc example.c lupng.c -DLUPNG_USE_ZLIB -lz
With miniz:
cc example.c lupng.c -Iminiz/
LuPng and miniz are licensed under the MIT license. See the files LICENSE and miniz/LICENSE respectively for details.