[][src]Function raster::save

pub fn save(image: &Image, out: &str) -> RasterResult<()>

Save an image to an image file. The image type is detected from the file extension of the file name.

Errors

This function can return RasterError::Io, RasterError::Encode, or RasterError::UnsupportedFormat upon failure. See error module for more info.

Examples

// Create an image from file
let image = raster::open("tests/in/sample.png").unwrap();
raster::save(&image, "tests/out/test.png").unwrap();