Rust JPEG 2000 codec

Pure-Rust JPEG 2000 Codec

Use j2k to inspect, decode, encode, and recode JPEG 2000 and HTJ2K codestreams and JP2/JPH files through safe Rust APIs. Unsafe implementation code remains behind documented boundaries.

Release status: See the changelog and crates.io for the current published version.

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 GPU backends.

cargo add j2k

Safe Rust API

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 extensions are not supported, except where ordinary JP2/JPH decoding needs them.