Search

Lib.rs

› Multimedia › Images
#encoding-decoding #encoder #decoder #apng #pure

png

PNG decoding and encoding library in pure Rust

Owned by Jonathan Behrens, Aurelia Molzer, image-rs.

  • Audit
  • Install
  • API reference
  • GitHub repo (image-rs)

60 releases

0.18.1 Feb 14, 2026
0.18.0 Aug 29, 2025
0.18.0-rc.3 Jul 2, 2025
0.18.0-rc Mar 3, 2025
0.3.1 Jun 15, 2015

#5 in Images

Download history 1515480/week @ 2026-01-16 1663634/week @ 2026-01-23 1838174/week @ 2026-01-30 2016977/week @ 2026-02-06 1957472/week @ 2026-02-13 2043518/week @ 2026-02-20 2244113/week @ 2026-02-27 2624394/week @ 2026-03-06 2620645/week @ 2026-03-13 2504148/week @ 2026-03-20 2498687/week @ 2026-03-27 2583891/week @ 2026-04-03 2753217/week @ 2026-04-10 2710249/week @ 2026-04-17 2960276/week @ 2026-04-24 2577823/week @ 2026-05-01

11,474,779 downloads per month
Used in 7,225 crates (602 directly)

MIT/Apache

480KB
9K SLoC

PNG Decoder/Encoder

Build Status Documentation Crates.io License

Robust and performant PNG decoder/encoder in pure Rust. Also supports APNG.

No unsafe code, battle-tested, and fuzzed on OSS-fuzz.

Performance

Performance is typically on par with or better than libpng.

Includes a fast encoding mode powered by fdeflate that is dramatically faster than the fastest mode of libpng while simultaneously providing better compression ratio.

On nightly Rust compiler you can slightly speed up decoding of some images by enabling the unstable feature of this crate.

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.6–0.8MB
~15K SLoC

  • bitflags 2.0
  • crc32fast
  • fdeflate
  • flate2
  • miniz_oxide+simd
  • dev approx
  • dev byteorder
  • dev clap+derive
  • dev criterion 0.7+cargo_bench_support
  • dev glob
  • dev rand 0.9.2

Other features

  • benchmarks
  • unstable
  • zlib-rs
Related: image-webp, fdeflate, weezl, jpeg-decoder, color_quant, tiff, gif, image
See also: lodepng, png_pong, bs58, hex, hex-conservative, gst-plugin-png, ravif, minipng, zune-core, png-decoder, zune-png

Lib.rs is an unofficial list of Rust/Cargo crates, created by kornelski. It contains data from multiple sources, including heuristics, and manually curated data. Content of this page is not necessarily endorsed by the authors of the crate. This site is not affiliated with nor endorsed by the Rust Project. If something is missing or incorrect, please file a bug.