‘Courageously standing up for what you believe in, despite being opposed by everybody else’ is held to be a good thing when people apply it to Christians and to soldiers who are willing to die for their (rather, specifically our) country, but it seems not to apply to Jeremy Corbyn.
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.