Decode
Whole images, crops and scaled output
Decode baseline, extended, progressive and lossless JPEG. Reduced IDCT paths provide one-half, one-quarter and one-eighth output for sequential and progressive DCT images.
JPEG / Rust / CPU + GPU adapters
j2k-jpeg is a pure-Rust JPEG inspection, decoding and encoding crate for general imaging, pathology, medical imaging and transcode pipelines.
01 / Workflows
Use one crate for ordinary JPEG input, DICOM-oriented 12-bit and lossless variants, TIFF tile normalization and baseline encoding.
Decode
Decode baseline, extended, progressive and lossless JPEG. Reduced IDCT paths provide one-half, one-quarter and one-eighth output for sequential and progressive DCT images.
Encode
Encode 8-bit baseline JPEG, 12-bit extended sequential JPEG and lossless JPEG with predictors, point transforms and restart intervals. The crate writes codestreams; containers remain the caller’s responsibility.
Integrate
Normalize abbreviated TIFF JPEG tiles with shared tables, repair zero-SOF dimensions from container metadata, and extract, insert or replace ordered APP2 ICC profile data.
02 / Coverage
Baseline, extended and progressive DCT coverage includes grayscale, YCbCr, RGB and Adobe CMYK/YCCK for supported sampling layouts.
Predictors 1–7, point transforms, restart intervals and split scans are supported within the published format boundary.
Arithmetic coding, hierarchical JPEG, four-component lossless JPEG and incompatible sampling layouts are rejected rather than guessed or silently converted.
Reference behaviorThe committed matrices compare supported decoded output with libjpeg-turbo and DICOM JPEG cases with DCMTK. See the crate README and source for the exact boundary.
03 / Install
Use j2k-jpeg directly for JPEG. Use j2k for JPEG 2000 and HTJ2K, or j2k-transcode for supported JPEG-to-HTJ2K coefficient-domain workflows.
$ cargo add j2k-jpegSafe Rust inspection, decode and encode APIs.
$ cargo add j2k-transcode