Skip to main content

encode

Function encode 

Source
pub fn encode(image: &Image, codec: ImageCodec, quality: u32) -> Result<Vec<u8>>
Expand description

Read normalized planar FP32 pixels and encode one still-image bitstream.

quality is used by the lossy JPEG and WebP encoders and must be in [1, 100] for those codecs. This is an explicit blocking host-observation boundary.

ยงErrors

Returns an error for Auto, unsupported image metadata, invalid quality, readback failure, checked-size overflow, or codec failure.