JPEG 2000 libraries for Rust
The image crate doesn’t support JPEG 2000. Two crates fill the gap:
- jpeg2k is a safe wrapper of OpenJPEG. It decodes everything OpenJPEG decodes, supports reduced resolution and region decoding, and converts to
image::DynamicImage. It builds OpenJPEG from source (C compiler needed) or links a system copy. - hayro-jpeg2000 is a pure-Rust decoder written for the hayro PDF renderer. No C code and no
unsafe(with thesimdfeature off),no_stdcompatible, and it registers itself as a decoding hook for theimagecrate. It produces 8-bit output and doesn’t encode.
Neither crate is a full encoder. To write JPEG 2000 from Rust, call OpenJPEG through openjpeg-sys or run opj_compress.
- hayro-jpeg2000 hayro-jpeg2000 is a memory-safe, pure-Rust JPEG 2000 decoder. How to add it, decode JP2 and J2K files to 8-bit pixels, convert to PNG with the image crate.
- jpeg2k jpeg2k is a safe Rust wrapper of OpenJPEG for loading JPEG 2000 images. How to add it, convert JP2 to PNG with the image crate.