imageio is a set of C functions that provide a simple way to read and write any image format that ImageMagick can read and write from. imageio supports reading/writing grayscale, grayscale+alpha, RGB, and RGBA images.
Download: imageio source code