Function save_buffer_with_format

Source
pub fn save_buffer_with_format(
    path: impl AsRef<Path>,
    buf: &[u8],
    width: u32,
    height: u32,
    color: impl Into<ExtendedColorType>,
    format: ImageFormat,
) -> ImageResult<()>
Expand description

Saves the supplied buffer to a file given the path and desired format.

The buffer is assumed to have the correct format according to the specified color type. This will lead to corrupted files if the buffer contains malformed data.