Skip to main content

write_rgba8

Function write_rgba8 

pub fn write_rgba8(
    path: impl AsRef<Path>,
    width: u32,
    height: u32,
    rgba: &[u8],
) -> Result<(), ImageError>
Expand description

Encode rgba as a PNG file at path, replacing any existing file.

ยงErrors

Fails when the file cannot be written or the buffer does not match the dimensions.