Skip to main content

Module png

Module png 

Expand description

Lossless PNG encoding and decoding of tightly packed 8-bit RGBA frames.

Screenshots, clipboard images, image widgets and test fixtures all move plain RGBA through PNG. These helpers keep that one path on the image codec the toolkit already carries for its other formats.

Structs§

Rgba8
A decoded PNG as 8-bit RGBA.

Functions§

decode_rgba8
Decode a PNG of any colour type and bit depth into 8-bit RGBA.
decode_rgba8_within
Like decode_rgba8, but rejects images with more than max_pixels pixels before decoding any image data.
encode_rgba8
Encode rgba (width * height * 4 bytes, row-major) as a PNG.
read_rgba8
Read and decode the PNG file at path into 8-bit RGBA.
write_rgba8
Encode rgba as a PNG file at path, replacing any existing file.