Project documentation

J2K: Rust JPEG 2000 / HTJ2K GPU Codec

Rust crates for JPEG 2000 and HTJ2K inspection, decode, encode, recode, and JPEG-to-J2K/HTJ2K transcode workflows. CPU is the portable baseline; CUDA and Apple Metal adapter crates cover supported GPU paths.

J2K pipeline: JPEG 2000, HTJ2K, and JPEG inputs flow through the j2k crate, which routes to CPU baseline, CUDA, and Metal backends.
One public crate, three input formats, three backends. CPU is the baseline; CUDA and Metal accelerate supported shapes.

Install

Most applications should start with the public facade crate.

cargo add j2k

Optional GPU crates

Add backend crates only when the application needs explicit device integration.

cargo add j2k-cuda --features cuda-runtime
cargo add j2k-metal

Package map

Crate Use
j2k Public API for JPEG 2000 / HTJ2K inspection, decode, encode, and recode.
j2k-cuda NVIDIA CUDA adapter for supported JPEG 2000 and HTJ2K backend paths.
j2k-metal Apple Metal adapter for supported macOS GPU paths.
j2k-transcode JPEG-to-J2K/HTJ2K transcode primitives and shared transcode contracts.

Topic pages

Backend behavior

CPU output is the correctness baseline. BackendRequest::Auto may return CPU output when a device path is unavailable, unsupported, or not benchmarked for the requested shape.

Explicit CUDA and Metal requests are strict. Unsupported shapes return errors instead of silently changing backend.

Benchmark claims should cite host hardware, operating system, input source, exact command, comparator availability, and comparator versions.