Rust JPEG 2000 codec

Pure-Rust JPEG 2000 Codec

Use j2k as a pure-Rust JPEG 2000 and HTJ2K codec: inspect, decode, encode, recode, handle JP2/JPH still-image containers, and process J2K/J2C codestreams through safe public APIs. Audited unsafe code remains isolated at documented implementation boundaries.

Release status: j2k 0.8.0 is published on crates.io; see the release policy for support details.

Rust JPEG 2000 codec pipeline

Primary crate

The public crate is j2k. Lower-level crates exist for native codec internals, shared contracts, JPEG input, and device adapters.

cargo add j2k

Audit posture

J2K exposes safe Rust APIs for decode, encode, component planes, row streaming, tile-batch decode, scaled region decode, scratch pools, backend requests, and compressed-payload passthrough checks.

Part 1 codestreams

Raw J2K/J2C support covers Part 1 still-image codestream parse, inspect, decode, encode, signed samples, high-bit samples, component counts, ROI, progression, tile parts, packet markers, and precinct/layer behavior tracked by the support matrix.

JP2 wrapper

JP2 still-image wrapping covers IHDR, COLR, BPCC, PCLR, CMAP, CDEF, ICC preservation paths, and codestream-brand validation for standard Part 1 still-image files.

Not JPX

JPX and JPEG 2000 Part 2 extension behavior is outside the claim unless a feature is required for ordinary JP2/JPH still-image correctness.