Metal JPEG2000 Rust

Metal JPEG2000 Rust

J2K provides Apple Metal backends for supported JPEG 2000 / HTJ2K device-output and encode-stage paths, plus supported coefficient-domain stages of JPEG-to-HTJ2K transcode workflows on macOS.

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

Expert API: The Metal crates use retained objc2-metal protocol objects directly and no longer depend on metal-rs. This is an intentional 0.9 breaking change; see the migration notes.

Metal JPEG2000 Rust pipeline

Codec backend

j2k-metal exposes Apple Metal-backed JPEG 2000 / HTJ2K decode and encode-stage APIs.

cargo add j2k-metal

JPEG input

j2k-jpeg-metal provides Metal-backed JPEG decode surfaces and selected baseline encode paths.

cargo add j2k-jpeg-metal

Transcode backend

j2k-transcode-metal accelerates supported coefficient-domain stages of JPEG-to-HTJ2K transcode on macOS; packetization remains outside those transform stages.

cargo add j2k-transcode-metal

Supported shape policy

Metal covers selected shapes. Explicit Metal requests return an unsupported-request error for other shapes.

The Metal backends support the same formats as the main crate: JPEG 2000 Part 1, JP2 files, HTJ2K Part 15, and JPH files. Shapes Metal does not support, or was not measured to speed up, run on the CPU.

Benchmark results are in docs/benchmark-evidence.md. Published Metal numbers list the hardware, commands, shapes, skipped rows, and publication_eligible=true from the benchmark tooling.