Skip to main content

Module format

Module format 

Source
Expand description

Image-file encodings the CLI reads and writes: PNG, netpbm (PPM/PAM), raw.

The codec itself only speaks raw RGBA/ARGB/BGRA, so this layer is what makes the tools accept .png inputs and emit .png outputs.

Modules§

png
PNG input/output via the png crate, normalized to RGBA8.
ppm
Netpbm binary PPM (P6, RGB) and PAM (P7, RGBA) I/O — dependency-free, for cwebp PPM/PAM inputs and dwebp -ppm/-pam outputs.
raw
Raw row-major pixel I/O (the codec’s native currency).

Enums§

InputFormat
An image encoding the CLI can read as encoder input.
OutputFormat
An image encoding the CLI can write as decoder output.

Functions§

read_image
Decode bytes in the given format into an Image.
to_rgba8
Return an image’s pixels as RGBA8, reordering from its stored layout.
write_image
Encode an Image into the given output format, returning file bytes.