pub fn ppm_encode(image: &RasterImage) -> Result<Vec<u8>, ErrorsJSL>
Encodes a one-channel image as binary PGM (P5) or a three-channel image as binary PPM (P6), with maximum value 255 or 65535 according to the bit depth.