Architectural Trade-offs · Measured Performance
Why IMI exists: trading 15% compression density for multi-gigabyte/s parallel decode and O(1) region access.
IMI is not a replacement for JPEG XL, AVIF, or JPEG in bandwidth-constrained web publishing. JPEG XL achieves better compression density on photographs and supports f32, HDR, and parallel decoding; zenjpeg with restart markers and parallel PNG extensions also scale across cores. IMI is designed for the regime where peak multi-threaded decode throughput, scientific/intermediate data fidelity (all 11 sample types from u8 through f64, 7 channel layouts including CMYK and Oklab), bounded 41 MB RSS gigapixel encoding, and 2-RTT HTTP byte-range random access are the primary constraints.
1. Peak Multi-Threaded Decode Throughput (Ryzen 9 7900X, Zen 4)
Every IMI coding mode—from Quick packet/bit-smart units to SplitHuf/RunLevel lossy DCT and 16-lane interleaved rANS lossless stripes—decomposes the image into independent row stripes and optional column groups. Within each lossless or lossy unit, 16 independent rANS state lanes decode in lockstep SIMD without cross-lane data dependencies:
| Workload & Sample Type | IMI Mode | Full-File Size | 1-Thread Decode | 8-Thread Decode | 8-Thread Encode |
|---|---|---|---|---|---|
| Photographs (RGB8, 24 bpp) | Lossless e7.5 (16-lane rANS) | 5.34 bpp (4.49:1) | 258.5 MP/s (0.78 GB/s) | 1,105.5 MP/s (3.32 GB/s) | 35.3 MP/s |
| Photographs (RGB8, 24 bpp) | Lossless e0 (16-lane rANS) | 6.07 bpp (3.95:1) | 269.7 MP/s (0.81 GB/s) | 1,120.6 MP/s (3.36 GB/s) | 42.4 MP/s |
| Photographs (RGB8, 24 bpp) | Quick Packets (lossless) | 10.72 bpp (2.24:1) | 163.5 MP/s (0.49 GB/s) | 771.4 MP/s (2.31 GB/s) | 559.0 MP/s (1.68 GB/s) |
| UI Screenshots (RGB8, 24 bpp) | Quick Packets (lossless) | 1.69 bpp (14.2:1) | 725.2 MP/s (2.18 GB/s) | 1,457.9 MP/s (4.37 GB/s) | 1,489.1 MP/s (4.47 GB/s) |
| Pixel Art (RGBA8, 32 bpp) | Quick Packets (lossless) | 0.29 bpp (108.6:1) | 1,713.2 MP/s (6.85 GB/s) | 1,822.4 MP/s (7.29 GB/s) | 2,966.8 MP/s (11.87 GB/s) |
| Text / Document (Gray8, 8 bpp) | Quick Packets (lossless) | 0.83 bpp (9.6:1) | 1,428.4 MP/s (1.43 GB/s) | 2,358.2 MP/s (2.36 GB/s) | 2,156.1 MP/s (2.16 GB/s) |
2. Scientific & Intermediate Data Workflows (32 Public Arrays, 7 Classes)
In scientific and intermediate workflows (astronomy CCD frames, digital elevation models, synchrotron photon-count detectors, microscopy, remote sensing), data is rarely 8-bit sRGB. IMI natively codes all 11 sample types—baseline u8, u16, f16, f32; signed i8, i16 via signed_samples; extended u32, i32; wide u64, i64, f64 via wide_samples—and 7 channel layouts (Gray, GrayAlpha, RGB, RGBA, CMYK, Oklab, OklabAlpha via pixel_models), using sparse 16-bit value-table maps (SPEC 2.1 map 9) when detector codes are sparse:
| Dataset Class (32 Arrays) | Sample Type | IMIJ Lossless e7.5 | Best Comparator (Lossless) | IMIJ 1T Decode | IMIJ 8T Decode |
|---|---|---|---|---|---|
| ESRF EIGER Photon Counts | u32 |
0.636 bits/sample | HDF5 bitshuffle+Zstd (0.897 bps, +41% larger) | 479 MS/s (1.92 GB/s) | 2,538 MS/s (10.15 GB/s) |
| SDSS DR7 Astro CCD | u16 |
4.975 bits/sample | JPEG-LS (5.021 bps, +0.9% larger) | 557 MS/s (1.11 GB/s) | 2,675 MS/s (5.35 GB/s) |
| Copernicus & USGS DEM | f32 |
12.411 bits/sample | HTJ2K (12.999 bps, +4.7% larger) | 427 MS/s (1.71 GB/s) | 2,503 MS/s (10.01 GB/s) |
| Sentinel-2 Remote Sensing | u16 |
8.419 bits/sample | JPEG XL e7 (7.442 bps, 11.6% smaller) | 531 MS/s (1.06 GB/s) | 2,799 MS/s (5.60 GB/s) |
| 3D Fluorescence Microscopy | u16 |
9.359 bits/sample | JPEG XL e7 (8.189 bps, 12.5% smaller) | 613 MS/s (1.23 GB/s) | 3,266 MS/s (6.53 GB/s) |
| ERA5 Climate CF Fields | f32 |
10.907 bits/sample | TIFF Deflate pred-3 (8.790 bps, 19.4% smaller) | 476 MS/s (1.90 GB/s) | 1,676 MS/s (6.70 GB/s) |
3. Self-Identifying Unit Ordinals (`unit_ordinals`, Feature 26) for 2-RTT HTTP ROI
When serving a single large .imi file over HTTP byte ranges using an untrusted trailing unit table (uTAB), Feature 26 (unit_ordinals, Head Record 37) prefixes each main unit record with its 0-based LEB128 varint ordinal. Region readers verify fetched spans locally in 2 HTTP requests (405 ms at 12.5 MB/s) instead of scanning all 352 record headers across the file (7,446 ms), at a cost of just +595 bytes (+0.020%) on a 3.01 MB file.
4. Candid Format Self-Critique: What Excels vs. Which Compression Methods Are "So-So"
Every format feature in IMI is evaluated against measured speed and compression studies across photographic, graphic, and scientific corpora. Here is an honest assessment of which techniques pay for themselves and which are currently "so-so":
| Mechanism / Subsystem | Verdict | Measured Evidence & Architectural Critique |
|---|---|---|
16-Lane Interleaved rANS + Independent Stripes/Groups (SPEC §2.5) |
★ Core Strength | Delivers 1.1–3.3 GB/s 8-thread native decode and 339–390 MP/s in 16-worker browser WASM without serial bitstream bottlenecks. |
16-Bit Sparse Value-Table Maps (SPEC §2.1 Map 9) |
★ Strong on u16/u32/f32; Mixed on x86 f16 | Smallest lossless coding on EIGER u32 photon counts (0.636 bps, 41% smaller than HDF5 bitshuffle+Zstd), SDSS u16 astro CCDs (4.975 bps), and SI-HDR f16 (−29% size, 0.94× EXR PIZ). Decode speed is 1.04–1.22× faster on f32 and 1.06–1.19× on Apple M4 Pro, but 0.79–0.92× slower on x86 f16 gather/lookup paths (value_tables = false keeps regular maps). |
Template Palettes & Bilevel Contexts (SPEC §2.6) |
★ Great on Dither/1-Bit; Needs Speed Gate on Screenshots | Cuts dithered/indexed graphic size by 2.90× (0.51–0.60× bytes) and speeds up 1-bit decode (1.27× Zen 4). However, because stripe selection currently compares bytes only without a decode-cost penalty, multi-color template stripes (k = 3..5) also win on 23/24 screenshots for ~1% byte savings at a ~7% 1-thread decode slowdown (0.925× aggregate). |
Unit Ordinals + Morton Pyramid Sets (Feature 26, imij-set) |
★ Core Strength | Eliminates the 352-request cold ROI header verification storm (down to 2 requests, 18.4× faster) for +0.020% file size. |
| Lossy DCT AC Coefficient Coding vs. JPEG XL VarDCT | So-So (~10–18% larger than JXL) | Trellis quantization gains −3.8% to −4.6% size in both RunLevel and SplitHuf, and adaptive 8×8/4×4 blocks help sharp edges, but IMI's AC coefficient coder stays ~10–18% larger than JPEG XL at matched SSIMULACRA2 / CVVDP on 512px+ photos because it avoids JXL's heavier 2D cross-coefficient context modeling to keep SIMD decode fast. |
Lossy Adaptive Quantization (HEAD_AQ) Map |
So-So (Currently Off by Default) | The wire syntax supports per-block AQ maps (HEAD_AQ), but across our paired SSIMULACRA2 + CVVDP studies with and without trellis quantization, no tested AQ heuristic improved both metrics simultaneously. Default aq_gamma is therefore 0 until a multi-metric masking model is tuned. |
Quick Packets on 8-Bit Natural Photographs (SPEC §2.13) |
Great on UI / 16b Shifts; So-So on 8b Photos | Quick mode excels on UI screenshots (1.69 bpp, 1.46 GP/s), pixel art (0.29 bpp), and shifted/replicated 16-bit sensors (--quick-bits saves 2.0×). On noisy 8-bit natural photos, however, Quick gets 10.72 bpp (2.24:1) at 163 MP/s (1T), whereas IMI Lossless Effort 0 (16-lane rANS) achieves 6.07 bpp (1.77× smaller) and decodes faster at 270 MP/s (1T) / 1,121 MP/s (8T). |
| Smooth 32-Bit IEEE Float Grids (ERA5 CF Fields) | Good on DEMs; So-So on Smooth CF Floats | IMI beats HTJ2K and JPEG-LS on f32 terrain DEMs (12.41 bps, 10 GB/s 8T decode), but on smooth ERA5 climate f32 fields (10.91 bps) it is ~19% larger than TIFF Deflate with horizontal byte-shuffle (8.79 bps), because byte-shuffling IEEE754 exponent bytes across a row compresses smooth float gradients tighter than whole-sample residual prediction. |