I have some code, once the base Java library for reading / writing PNG files: http://code.google.com/p/pngj/
It does not support images on pallets, but besides this [Updated: it supports all PNG options now], it is quite complete, simple and the code has no external dependencies (that is, it uses only the standard JSE API, which includes ZIP decompression ) And the code is available. I think you could shift it to C with a little effort.
source
share