Skip to main content

write_ppm

Function write_ppm 

Source
pub fn write_ppm<P: Pixel, W: Write>(
    bitmap: &Bitmap<P>,
    out: W,
) -> Result<(), EncodeError>
Expand description

Write bitmap to out as a binary PPM (P6) image.

The sink out is consumed; wrap in std::io::BufWriter if buffering is needed.

§Errors

Returns EncodeError::UnsupportedMode for grayscale or 1-bit modes — use write_pgm for those. Returns EncodeError::Io on any I/O failure.