JXL Encoder -- jxl-rs vs libjxl

Updated 2026-03-14 Pure Rust, no C/C++ FFI libjxl v0.7 effort 3 (Squirrel) Use tabs to jump between demos

Test Suite: jpegxl.info + Kodak (RGB)

Drag slider: jxl-rs on left. Right side can be libjxl or original JPEG.

Compare right side:

Progressive Encoding Sample

Progressive sample.

Compare right side:

Alpha Channel Support

Dice image (800x600 RGBA), lossy alpha compare.

Compare right side:

Animation Encoding (RGBA)

Animated JPEG XL with alpha. Source APNG is reference.

Source APNG
Source APNG
968.5 KB
jxl-rs animation
jxl-rs
475.9 KB JXL
libjxl animation
libjxl
428.1 KB JXL

Lossless Sample

Pixel-exact lossless compare on Kodak #01.

Compare right side:

Benchmark Summary (d=1.0, Squirrel speed)

ImageDims libjxl (KB)jxl-rs (KB)Size delta libjxl PSNRjxl-rs PSNRPSNR delta

Baseline: libjxl e3 (Falcon). Size delta = (jxl-rs / libjxl - 1) * 100. PSNR delta = jxl-rs - libjxl (dB).

SIMD Progress

Encoder SIMD rollout is active. Current scope includes XYB, forward transforms (8x8/16x16/16x8/8x16/32x32), quant-field loops, and coefficient-order prepass helpers.

Targets: XYB >=1.5x, transform-heavy >=1.8x vs scalar. Current host sample is still below both targets (tracking only).

MetricValue
XYB scalar (1024x768)41.376 ms
XYB assisted SIMD (Avx512)47.904 ms
XYB speedup0.86x
DCT32 scalar (Avx512 host)210.442 us
DCT32 SIMD (Avx512 host)659.238 us
DCT32 speedup0.32x
Plan progress54 done, 0 in progress, 0 open

Encode-time comparison on this host (3 runs avg, d=1.0) is shown below for jxl-rs vs libjxl.

Samplejxl-rs encodelibjxl encodeRatio
Webkit-logo-P34.416 s0.043 s103.1x
dice (RGBA)40.518 s0.102 s397.8x
kodim011.810 s0.030 s60.3x
kodim021.674 s0.039 s42.5x
kodim031.548 s0.057 s27.0x
kodim041.662 s0.051 s32.3x
kodim051.115 s0.076 s14.7x
kodim061.791 s0.078 s22.8x
kodim071.553 s0.043 s35.9x
kodim082.049 s0.042 s49.3x
kodim091.627 s0.031 s52.7x
kodim101.632 s0.028 s57.5x
kodim111.770 s0.062 s28.4x
kodim121.513 s0.026 s58.2x
kodim131.982 s0.031 s64.7x
kodim141.831 s0.031 s58.5x
kodim151.551 s0.028 s55.6x
kodim231.424 s0.029 s49.3x
zoltan4.154 s0.044 s94.7x

All numbers are host-dependent and intended for trend visibility only. 3-run median, --release build, d=1.0, jxl-rs effort 7 / libjxl effort 3.