Add support for read and write PNG and PGM files.