#png #image-decoder #image #decoder

png-decoder

A pure-Rust, no_std compatible PNG decoder

3 unstable releases

0.2.0 Oct 2, 2025
0.1.1 Oct 9, 2022
0.1.0 Jan 3, 2021

#78 in Images

Download history 841/week @ 2025-08-27 861/week @ 2025-09-03 400/week @ 2025-09-10 972/week @ 2025-09-17 1217/week @ 2025-09-24 1510/week @ 2025-10-01 1421/week @ 2025-10-08 2441/week @ 2025-10-15 1585/week @ 2025-10-22 1304/week @ 2025-10-29 775/week @ 2025-11-05 2139/week @ 2025-11-12 3145/week @ 2025-11-19 2690/week @ 2025-11-26 2626/week @ 2025-12-03 2898/week @ 2025-12-10

11,647 downloads per month
Used in 11 crates (4 directly)

MIT OR Apache-2.0 OR Zlib

39KB
824 lines

png-decoder

A pure-Rust, no_std compatible PNG decoder.

See examples/basic.rs for basic usage. The decode() function returns a PNG header and associated byte data, represented as RGBA (8 bits per channel).

Dependencies

  • cargo
  • rustc

Build

$ cargo build --release

Testing

$ cargo test

Code Format

The formatting options currently use nightly-only options.

$ cargo +nightly fmt

Code Linting

$ cargo clippy

Code Fuzzing

Fuzzing requires a nightly toolchain. Fuzzing for this project is currently confirmed to work with:

+nightly-2020-10-07

Running

cargo install cargo-fuzz
cargo +nightly-2020-10-07 fuzz run png_decoder_fuzzer

Dependencies

~0.4–0.9MB
~18K SLoC