PortableFormatWriter
Currently, the encoder only output ppm files, but it can easily be extended to support both PBM and PGM.