Crates.io | zune-png |
lib.rs | zune-png |
version | 0.5.0-rc1 |
source | src |
created_at | 2023-03-29 08:21:33.254664 |
updated_at | 2024-04-16 06:33:14.307675 |
description | A fast, correct and safe png decoder |
homepage | |
repository | https://github.com/etemesi254/zune-image/tree/dev/zune-png |
max_upload_size | |
id | 823850 |
size | 186,336 |
A fast, correct and safe png decoder
First, include this in your Cargo.toml
[dependencies]
zune-png = "0.2.0"
Then you can access the decoder in your library/binary.
use zune_png::PngDecoder;
// decode bytes
let decoder = PngDecoder::new(b"bytes").decode().unwrap();
The decoder heavily relies on platform specific intrinsics, namely AVX2 and SSE to gain speed-ups in decoding,
but they perform poorly in debug builds. To get reasonable performance even
when compiling your program in debug mode, add this to your Cargo.toml
:
# `zune-png` package will be always built with optimizations
[profile.dev.package.zune-png]
opt-level = 3
The updated benchmarks comparing this decoder with other Rust and C decoders can be
found here with
the png
prefix. Benchmarks are updated regularly to keep up with optimizations added.