Encodes as binary PPM (P6), or PGM (P5) for gray; alpha is dropped.
encode_ppm :: (image: Image) -> [] u8