# Pure-Rust JPEG 2000 codec

Canonical page: https://frames-sg.com/j2k/rust-jpeg2000-codec/

The `j2k` crate provides safe Rust APIs for inspecting, decoding, encoding, and recoding JPEG 2000 and HTJ2K codestreams and JP2/JPH still-image files. Most applications should start with:

```sh
cargo add j2k
```

## Public API

The public surface includes decode, encode, component-plane access, row streaming, tile-batch decode, scaled region decode, native wavelet-band extraction, scratch pools, backend requests, and compressed-payload passthrough checks. Lower-level crates contain native codec internals, shared contracts, JPEG input, and GPU acceleration.

## JPEG 2000 and JP2

Part 1 J2K/J2C codestream support includes parsing, inspection, decoding, encoding, signed and high-bit samples, multiple components, regions of interest, progression orders, tile parts, packet markers, and precinct and quality-layer behavior tracked by the support matrix. JP2 still-image support includes IHDR, COLR, BPCC, PCLR, CMAP, CDEF, ICC preservation paths, and codestream-brand validation.

JPX and other JPEG 2000 Part 2 extensions are not supported except where ordinary JP2 or JPH decoding requires them.

## Related resources

- [Exact support matrix](https://github.com/frames-sg/j2k/blob/main/docs/public-support.md)
- [J2K API documentation](https://docs.rs/j2k)
- [GPU acceleration](https://frames-sg.com/j2k/gpu-jpeg2000-rust/)
- [HTJ2K Part 15](https://frames-sg.com/j2k/htj2k-rust/)
- [Source repository](https://github.com/frames-sg/j2k)
