pub fn write_image(
image: &Image,
format: OutputFormat,
metadata: &Metadata,
) -> Result<Vec<u8>, CliError>Expand description
Encode an Image into the given output format, returning file bytes.
metadata is embedded only by formats that support it (PNG); netpbm and raw
ignore it.
ยงErrors
CliError::Format if PNG encoding fails.