Skip to content
프로젝트

소개

jxl-rs is a high-performance, conforming, and memory-safe JPEG XL decoder written in Rust.

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+2
in 7 days
+6
in 15 days
+13
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

JPEG XL in Rust (jxl-rs)

CI Crates.io Docs.rs Discord

JXL logo

jxl-rs is a high-performance, conforming, and memory-safe JPEG XL decoder written in Rust.

It is the JPEG XL decoder implementation used in Google Chrome / Chromium and Mozilla Firefox.

JPEG XL was standardized in 2022 as ISO/IEC 18181. While libjxl (C++) is the official ISO/IEC 18181-4 reference software, jxl-rs is a pure-Rust implementation developed within the JPEG XL project. It is not (yet) an official reference implementation, it aims for full specification conformance, memory safety, and high decoding performance across diverse hardware architectures.

The performance of jxl-rs closely matches (and sometimes exceeds) the C++ reference implementation, while having improved support for progressive rendering and lower memory requirements.

Safety

The vast majority of the code uses safe Rust. Where unsafe is needed for performance benefits (including SIMD), we require unsafe code to have extensive safety comments and to be reviewed by a non-author Unsafe Rust expert.

Workspace Crates

Usage

# Build
cargo build --release --bin jxl_cli

# Decode an image (PNG, PPM, PGM, APNG, EXR)
target/release/jxl_cli input.jxl output.png

# Print image metadata
target/release/jxl_cli input.jxl --info

# Benchmark decoding speed
target/release/jxl_cli input.jxl --speedtest --num-reps 10

The jxl crate is also available on crates.io for use as a library.

image crate integration

Add the integration crate and register the JPEG XL decoder before using image's format-agnostic loading APIs:

[dependencies]
image = "0.25"
jxl-image-rs-integration = "0.6"
jxl_image_rs_integration::register_image_decoding_hook();

let decoded = image::open("input.jxl")?;
# Ok::<(), image::ImageError>(())

Registration enables both .jxl extension handling and automatic detection of bare codestreams and JPEG XL containers.

HDR gain map boxes

Use jxl-gainmap and its JxlGainMap type to parse a captured jhgm payload. See the crate README for usage.

Testing

# Run workspace tests
cargo test --release --all

# Run Shuttle concurrency tests
cargo test --release --features shuttle shuttle

To run property-based tests with extended budget:

ARBTEST_BUDGET_MS=10000 cargo test --release --all
SHUTTLE_ITERATIONS=100 cargo nextest run --features shuttle -- shuttle

Conformance & Bug Reports

We strive to decode all conformant JPEG XL bitstreams correctly. If you encounter an image that decodes with the reference implementation djxl (from libjxl) but fails or renders incorrectly with jxl-rs, please open an issue.

Community & Contact

관련 프로젝트 살펴보기

불러오는 중…