GPU-Accelerated JPEG 2000 in Rust

Accelerate supported JPEG 2000 and HTJ2K operations with Apple Metal or NVIDIA CUDA. Portable CPU decoding and encoding are also available.

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

J2K libraries with Apple Metal, NVIDIA CUDA and CPU execution

Apple Metal

j2k-metal, j2k-jpeg-metal and j2k-transcode-metal accelerate supported codec operations on Apple GPUs.

NVIDIA CUDA

j2k-cuda, j2k-jpeg-cuda and j2k-transcode-cuda use Rust kernels compiled with cuda-oxide for supported NVIDIA GPU operations.

CPU

Portable CPU decoding and encoding are available without a GPU. Automatic selection uses the CPU when a suitable GPU route is unavailable or has not measured faster.

GPU selection

BackendRequest::Auto uses the CPU for shapes the GPU does not support or was not measured to speed up. Explicit Metal or CUDA requests return an error for unsupported shapes.

GPU acceleration covers supported operations on JPEG 2000 Part 1 codestreams, JP2 files, HTJ2K Part 15 codestreams and JPH files. Coverage depends on the image and operation; some stages run on the CPU. CUDA and Metal decodes of signed grayscale and color sources follow the CPU's sample conversion.

Use docs/public-support.md for codec support. Benchmark results are in docs/benchmark-evidence.md; published comparisons need an external benchmark bundle with publication_eligible=true.