Skip to main content

encode_png_rgba

Function encode_png_rgba 

Source
pub fn encode_png_rgba(width: u32, height: u32, pixels: &[u8]) -> Vec<u8> ⓘ
Expand description

Encodes tightly packed RGBA8 pixels as a PNG image.

Uses stored (uncompressed) DEFLATE blocks so no compression dependency is required; the resulting file is larger than a compressed PNG but fully valid and readable by any PNG consumer.