I have made a small and simple library for creating PNG files in C. The source code is available here.
The library (especially the workhorse inside it) is largely taken from Ben Bullock’s tutorial. I added some extra functions: a constructor and a destructor are provided, some error-handling is added, and there is a routine that creates an image out of a two-dimensional array of doubles.
To compile and install: Change the INSTALL_PREFIX in Makefile to an appropriate location (possibly something like /home/username/local or /usr/local, and then run
$ make install
To use, compile your code and link using the flags -lpng -lpnghelpers.
Some example codes are provided, although usage should be self-explanatory.