added an image writer in c

depends on libpng