Expand description
PNG images (ISO/IEC 15948): a lossless codec and file helpers.
Decoding supports every standard colour type (greyscale, RGB, palette, grey + alpha, RGBA)
at every bit depth, all five scanline filters, Adam7 interlacing and palette transparency
(tRNS, which expands a palette image to RGBA). Samples come out as 8 bits, or 16 bits for
16-bit images; low bit-depth greyscale is scaled to 8 bits. Encoding writes non-interlaced
8- or 16-bit greyscale, grey + alpha, RGB or RGBA, choosing a filter per row by the usual
minimum-sum-of-absolute-differences heuristic, compressed with crate::deflate.
See the book entry Image files.
Structs§
- Raster
Image - A raster image with interleaved samples, shared by the lossless formats.
Functions§
- png_
decode - Decodes a PNG byte stream.
- png_
encode - Encodes an image as PNG (zlib
level0 to 9). - read_
png_ file - Reads a PNG file.
- write_
png_ file - Writes a PNG file (zlib level 6).