Codec Strategy for Digital Pathology and Large-Format Medical Imaging Executive Brief

A Two-Architecture Decision Framework
Version 7 · September 2026 · Dicom Systems

This is a summary, condensed from the full whitepaper. Detailed methodology, per-tile data tables with IQR, the verification log, open items, and the 44 references are in the Online Appendix, referenced by section letter throughout; bracketed numbers are entries in its reference list (Appendix N).

Executive Summary

This whitepaper measures four standardized, DICOM-transferable codecs: HTJ2K, classic JPEG 2000, JPEG-LS, and JPEG XL on real whole-slide pathology tissue, and states what the measurements support for the choice of archive and viewing formats. The question is timely; DICOM standardized JPEG XL transfer syntaxes in September 2024 (Supplement 232) [1], alongside the HTJ2K syntaxes of Supplement 235 [2], so a pathology archive now has two credible candidates for its master format where it recently had one. Measurements were made on three de-identified slides spanning two stains and two scanner formats, at 4096px and 8192px, with every timing traced to its source, and the two measurement artifacts found along the way are documented in full rather than absorbed silently.

Recommendation

  • HTJ2K is the master format for interactive viewing and streaming.
    Fastest codec measured in both directions; decode latency that varied under 1% across slides at 4096px; and the only codec here with a DICOM-standardized progressive-streaming profile. RPCL order and tile markers (Supplement 235), plus JPIP-referenced syntaxes in which AWS HealthImaging stores most lossless frames by default (some inputs retain their original syntax).
  • JPEG XL replaces JPEG-LS for the archive and delivery tier.
    Smallest lossless files of any codec tested, on every tile; JPEG-LS did not lead on any measured axis.
  • End-to-end JPEG XL is coherent under two conditions.
    Encode cost absorbed off the critical viewing path (at effort 7 the penalty is at least 78-95× HTJ2K’s encode time; about 13× at effort 3, measured at 4096px), and viewing served either by a supported direct JPEG XL viewer or by a bounded derived rendition cache, since this study did not identify or verify a medical viewer or DICOM delivery path using JPEG XL progressive decode. Native JPEG XL acquisition reduces conversion work but is not required; encoding at ingest is equivalent for the archive.
  • Unifier operates as the transcoding and routing layer under either architecture.
    The codec decision and the orchestration requirement are separable.

Key findings

#FindingWhere
1JPEG XL produced the smallest lossless files on every tile tested, 11-15% smaller than HTJ2K’sLossless
2HTJ2K was the fastest codec in both directions: at least 11× faster than classic J2K to encode, and 6-8× faster to decode to a file or 18-25× faster to decode into memoryLossless, Decode
3JPEG XL’s compression advantage costs at least 78-95× HTJ2K’s encode timeLossless
4At equal compression ratio, HTJ2K accepts a small quality deficit against J2K and a larger one against JPEG XL at aggressive ratios, in exchange for a 1.4-2.0× decode advantage over bothLossy
5JPEG-LS did not lead on any axis measured and has no role in the recommendationConclusion

Multi-codec summary

CodecLossless ratioEncode 4096pxDecode 4096pxDecode 8192px
HTJ2K1.59-2.13×59.4 ms32.4 ms131.4 ms
Classic J2K1.71-2.33×682.3 ms652.4 ms2484.5 ms
JPEG-LS1.56-2.14×1195.3 ms972.5 ms3767.7 ms
JPEG XL lossless, e71.78-2.45×4828.4 ms780.3 ms3080.4 ms

Median of three slides, lossless. Decode is in-memory (what a viewer does); decode to a file is 2.7-3.0× slower for HTJ2K, ratios against 50.3 MB (4096px) and 201.3 MB (8192px) raw RGB. Encode figures are lower bounds (Methodology).

Why Digital Pathology Breaks Old Assumptions

A slide scanned at 40× produces 80,000-150,000 pixels per side, six to twenty billion pixels stored as a resolution pyramid. Three consequences drive the codec decision: tile-level random access matters as much as file size (a 10 GB slide is never decoded in full to view one region); bit depth and color fidelity carry diagnostic information (chroma subsampling and bit-depth ceilings bound what a pathologist or algorithm can resolve); and archives are write-once, read-rarely, retain-indefinitely, which motivates tiering by storage class where codec family is the wrong tier boundary, because crossing codestream families costs a full decode and re-encode rather than a compressed-domain transcode.

Figure 1. Pipeline topology for a mixed legacy scanner fleet. Codec selection occurs once during the normalization step and constrains every downstream consumer. Most slide digitizers have no native DICOM support; Unifier’s ingestion accepts iSyntax, NDPI, SVS, and TIFF and produces Supplement 145 DICOM for the PACS and for Unifier AI Conductor’s AI-orchestration capability, which routes studies to containerized inference services concurrently. This paper is scoped to that step.

Testing Methodology

Figure 2. The three source slides with the benchmarked regions marked. Box positions are the offsets recorded in the benchmark manifest; tile previews are downscaled from the same files the benchmark encoded rather than re-detected afterward. Tiles were extracted at 4096px and 8192px per slide.

ItemDetail
EnvironmentAWS c6i.2xlarge Intel Xeon 8375C (Ice Lake), 4 cores / 8 vCPU, 16 GiB, Ubuntu 24.04; AVX2 and AVX-512 confirmed from lscpu. Storage: gp3 EBS at its 125 MiB/s baseline, the fact behind two controlled measurements (below).
CodecsKakadu v8.7 (HTJ2K: Cmodes=HT Creversible=yes Clevels=5 Cblk={64,64}; J2K: same without HT); libjxl v0.13.0 (–num_threads=-1); pillow-jpls 1.3.2 (CharLS); OpenSlide 4.0.1. Thread counts sampled live: kdu_compress 8, kdu_expand 8, cjxl 9.
Test dataThree de-identified slides: Burkitt lymphoma (CD3 IHC, Aperio SVS, source J2K); gastric adenocarcinoma TCGA-BR-8081 (H&E, Aperio SVS, baseline JPEG); CMU-2 (H&E, Hamamatsu NDPI, baseline JPEG). Tiles at 4096px and 8192px, placed on dense tissue. An early region detector was fooled by adipose tissue; correcting one CMU-2 region moved every codec’s ratio 15-25%.
Protocol20 measured + 3 warmup iterations; median and IQR; all samples retained. Lossless verified by pixel comparison; all 36 artifacts reproduced byte-identically (SHA-256) between runs. Six tiles from three slides is directional, not statistically definitive. Lossy quality: SSIM, SSIMULACRA2 and Butteraugli on every measurement, because they disagree, structural-fidelity proxies, not diagnostic-safety claims.

Two scope notes. Lossless means the extracted source pixels are reproduced exactly; it does not restore information the scanner’s own JPEG or JPEG 2000 compression had already discarded, and every ratio here is against decoded pixels (50.3 MB and 201.3 MB per tile), not against the scanner’s file. And Condition C removes a process boundary and a file write, so the B-to-C difference is not attributable to storage alone.

Two storage artifacts, controlled. The original harness’s decode figures and its encode figures recorded the storage volume’s throughput rather than the codec: every decode wrote a full-size PPM (48 MiB at 4096px, 192 MiB at 8192px) to the 125 MiB/s volume, so any codec fast enough to reach that limit measured the volume’s drain rate; the symptom was HTJ2K decode within 0.10% across three slides whose compressed sizes differed by 31%. The control was a comparison on the same instance: Conditions A (EBS, defect reproduced live), B (RAM-backed filesystem), and C (in-process), with JPEG-LS, which writes no PPM, as the negative control (it moved 0.47%). HTJ2K 8192px decode fell from 1535.0 ms to 360.6 ms (B) and 131.4 ms (C). Condition D then moved the encode output to RAM: HTJ2K encode fell by 3.04-3.92×, while the JPEG XL control moved by 1.00-1.01×. About half of each HTJ2K encode measurement is still a memory write, so every HTJ2K encode figure is a lower bound; the bias runs against HTJ2K, and no conclusion reverses (Appendix C, D, J).

Lossless: Compression Ratio and Encode Speed

CodecRatio (6 tiles)Encode 4096pxEncode 8192pxEncode vs HTJ2K
HTJ2K1.59-2.13×57.7-62.6 ms211.2-225.0 ms—
Classic J2K1.71-2.33×635-821 ms2,490-3,040 ms≥ 11.0-13.5× slower
JPEG-LS1.56-2.14×1,193-1,248 ms4,641-4,760 ms~20× slower
JPEG XL lossless, e71.78-2.45×4,653-5,737 ms18,168-21,333 ms≥ 78-95× slower

The compression ranking is invariant: JPEG XL > classic J2K > HTJ2K ≈ JPEG-LS on every tile without exception; JPEG XL’s 12-18% ratio advantage over HTJ2K gives files 11-15% smaller, at a cost of at least 78-95× HTJ2K’s encode time at effort 7 (about 13× at effort 3, a 4096px measurement below). JPEG-LS edged HTJ2K on ratio on the two TCGA tiles and lost elsewhere; it never produced the smallest file. JPEG-LS underperformed specifically for immunohistochemistry, achieving 1.61-1.64× compression on the CD3 slide. In contrast, wavelet codecs achieved 2.10-2.33× compression, a stain-dependent effect that argues for validating codec selection against a deployment’s own stain distribution. Per-tile values with IQR, and the ratio-against-encode-time plot of all 24 measurements (Figure 3), are in Appendix E.

Decode Speed and Latency Consistency

Both conditions are reported because they measure different operations: B is decode to a file, C is decode into memory, the operation an interactive viewer performs. The three-condition comparison with the storage ceiling marked is shown in Figure 8 of Appendix D.

Codec4096px (B file / C memory)vs HTJ2K8192px (B / C)vs HTJ2K
HTJ2K97.1 / 32.4 ms—360.6 / 131.4 ms—
Classic J2K674.5 / 652.4 ms6.9× / 20.1×2558.4 / 2484.5 ms7.1× / 18.9×
JPEG XL lossless, e7856.7 / 780.3 ms8.8× / 24.1×3358.7 / 3080.4 ms9.3× / 23.4×
JPEG-LS974.1 / 972.5 ms10.0× / 30.0×3904.1 / 3767.7 ms10.8× / 28.7×

Medians across three slides; per-tile HTJ2K-vs-J2K ranges are 6.4-8.3× (file) and 17.9-24.6× (memory). At 4096px, HTJ2K decode time varied by under 1% across the three slides: a 31.4% spread in compressed size produced a 0.90% spread in decode time (32.5, 32.4, 32.3 ms), and the between-slide range of 0.29 ms is one-tenth of the within-slide IQR. Classic J2K tracks bitstream size almost one-to-one (31.0% spread). At 8192px, the result is unresolvable at three slides (range ÷ IQR = 1.12), so the claim is confined to 4096px. With three slides, that is low observed between-slide variation, not proof of content-independent latency or a worst-case bound.

Lossy: Quality at Equal Compression Ratio

Comparing codecs at their own quality settings involves comparing incommensurable parameters, so HTJ2K and classic J2K were encoded to match JPEG XL’s achieved byte count per tile (within 2.0% across all 24 pairs). 4096px medians across three slides; 8192px follows the same pattern (Appendix H):

Matched ratioCodecEncodeDecode (file)SSIMSSIMULACRA2
10.5×HTJ2K72.5 ms89.6 ms0.97085.2
 J2K300.9 ms177.7 ms0.97387.0
 JPEG XL2196.6 ms183.2 ms0.97088.1
24.0×HTJ2K59.0 ms85.3 ms0.92864.7
 J2K189.7 ms119.9 ms0.93167.3
 JPEG XL2302.4 ms160.2 ms0.93473.6

HTJ2K encoded 3.2-4.3× faster than J2K and 30-82× faster than JPEG XL, and decoded 1.4-2.0× faster than either, at lower measured quality, marginally against J2K (0.9-2.6 SSIMULACRA2), and substantially against JPEG XL at high ratios (2.9 points at ~10.5×, 8.4-8.9 at ~24×). At moderate compression, the three are close enough that speed dominates; at aggressive compression, JPEG XL’s quality lead is large while its encode cost reaches 82×. The three metrics disagree at JPEG XL’s default “visually lossless” distance 1.0, consistently: SSIM 0.94-0.98 and SSIMULACRA2 86-89 read as excellent; Butteraugli max-norm was 1.3-1.5 on all three measured 4096px tiles, above the 1.0 libjxl defines as visually lossless; the 8192px JPEG XL Butteraugli values are retained from the initial run and are not treated as final validation results (Appendix F). The disagreement is reported, not resolved by picking a metric. Baseline JPEG at matched bytes trailed JPEG XL by 3.8-6.1 SSIMULACRA2 at ~10.5× and 14.8-15.9 at ~24×; HTJ2K matched or beat JPEG 4:4:4 at every point (Appendix F, H). [12,13,14]

JPEG XL Encoder Effort

EffortBLGSP ratio / encodeCMU-2 ratio / encodeTCGA ratio / encode
11.87× / 160 ms1.57× / 240 ms1.85× / 160 ms
32.34× / 768 ms1.77× / 837 ms2.19× / 780 ms
52.40× / 2,220 ms1.78× / 2,447 ms2.19× / 2,199 ms
72.41× / 4,829 ms1.78× / 5,740 ms2.21× / 4,649 ms
92.50× / 18,358 ms1.80× / 27,303 ms2.26× / 16,782 ms

 

Lossless, 4096px. At effort 3, encode is 768-837 ms, 13.1-13.4× the paired HTJ2K time, against 78-95× at effort 7 for ratios of 1.77-2.34×. Effort 1→3 is the only step that exchanged time for a substantial gain (13-25%, sub-second cost); effort 7→9 cost 3.6-4.8× the time on lossless and 17-18× on lossy, and at effort 9 lossy SSIM decreased on every slide. Provisional guidance: effort 3 for lossless, effort 5 for lossy; effort 9 is not recommended at any synchronous encode point. Provisional deliberately derived from three slides and structural-proxy metrics, the caps mark where the compression curve flattens, not where fidelity becomes adequate (Appendix I).

Clinical Risk and Validation Evidence

  • DICOM does not address clinical acceptability (PS3.5 §8.2.1 [17]: the context in which lossy compression is acceptable, and parameter selection, are “beyond the scope of the DICOM Standard”). The European Society of Radiology [18]’s position paper supplies the accountability model (vendors flag irreversible compression and never re-compress with different parameters; users choose ratios and run QA); the ACR-AAPM-SIIM standard permits it only where quality suffices for the clinical task.
  • Published thresholds are task-specific. Chen, Janowczyk and Madabhushi (JCO CCI 2020) [20] found pathology images can be compressed by 85% while retaining 95% of deep-learning performance, report pathologist-set maxima of PSNR 30 dB for two tasks and 22 dB for a third, and advise care below 40 dB. None transfers automatically to JPEG XL at a given metric reading; no validated pathology-specific perceptual metric is known to the authors.
  • Recommended validation: run the deployment’s own downstream task mitotic counting, nuclear morphometry, inference, or a reader study against source and compressed images at the candidate setting and measure task-specific agreement directly. That is what would convert the provisional effort caps into firm ones (pixel crops in Appendix F, Figure 6).

Progressive Streaming: Standardized Profile vs Codec Capability

 HTJ2KJPEG XL
Progression and protocolRPCL order registered as its own DICOM syntax (.202); Supplement 235 requires tile length markers for “smart streaming”; JPIP (ISO/IEC 15444-9) with DICOM JPIP-referenced syntaxes. DICOMweb WADO-RS frame retrieval is codec-neutral and serves either codecProgressive decode is a genuine, designed capability; no JPIP equivalent and no medical streaming protocol built on it. Frame-level WADO-RS retrieval works the same as for HTJ2K
Implementations in the fieldAWS HealthImaging stores most lossless frames as HTJ2K with RPCL (.202) by default; some inputs retain their original syntax, and a datastore can be configured for JPEG 2000 Lossless. GPU decode via NVIDIA nvJPEG2000No whole-slide viewer known to the authors decodes JPEG XL progressively; Safari, the one shipping browser implementation, does not support progressive download
Cloud storageDefault storage format for most lossless frames (.202 RPCL); some inputs retain their original syntax; JPEG 2000 Lossless configurableAWS HealthImaging stores and returns lossy JPEG XL (.112) without transcoding since 2 Feb 2026; lossless .110 is not on its supported-syntax list; storage fidelity, not progressive streaming

HTJ2K has a standardized RPCL and tile-marker profile (Supplement 235 [2]), and AWS HealthImaging stores most lossless frames in that profile by default, with some inputs retaining their original syntax; this study did not verify the existence of a viewer that exploits it. JPEG XL supports progressive decoding in the codec, but no medical viewer or DICOM delivery path that uses it has been verified. WADO-RS is codec-neutral. Frame-level retrieval is therefore not the differentiator; the difference lies in progressive refinement within a frame, which HTJ2K’s profile is built for and which no medical viewer or DICOM delivery path has been identified or verified to provide for JPEG XL. That distinction should determine the architecture selected today, independently of all the compression measurements above. A deployer choosing JPEG XL as the master obtains the best lossless ratio and cloud storage support, and must serve viewing via either a derived HTJ2K rendition or a JPEG XL medical-viewer path, which was not verified in this study. The decode data agrees: 32.4 ms per 4096px tile in memory against JPEG XL’s 780.3 ms.

Backward Compatibility: HTJ2K ↔ J2K Transcoding

HTJ2K and classic J2K share a codestream family: conversion re-codes the block-coder layer while preserving the wavelet data, no pixel decode, no loss for lossless sources. No other pair of codecs here has this property. Both readings are reported:

DirectionEqual-thread comparisonProduction, out of the box
J2K → HTJ2KTranscode 1.1-2.0× faster than full re-encodeTranscode 1-7× slower; 2-3× on real pathology tiles
HTJ2K → J2KTranscode 48-62× fasterTranscode 5-14× faster (34.2 ms vs 468.8 ms, 8192px)

The columns differ because kdu_transcode is single-threaded; Kakadu documents it as a demonstration application and points licensees to the low-level API for multi-threaded transcoders. HTJ2K→J2K is fast under either measurement, so real-time proxy compatibility with J2K-only consumers is straightforward; J2K→HTJ2K migration should use a multi-threaded pipeline. SHA-256 round trips 12/12 both directions. Platform caveat: measured on a different host (AMD Ryzen, AVX2 only, Kakadu 8.6.1, different tiles); compare ratios within this table only (Appendix J). JPEG-LS has no compressed-domain exit in either direction: conversion to JPEG XL or to HTJ2K is a full decode and re-encode, costed in the ROI section.

DICOM Transfer Syntaxes

CodecUID (1.2.840.10008.1.2.4.…)Registered name
HTJ2K / HTJ2K RPCL / HTJ2K lossy.201 / .202 / .203High-Throughput JPEG 2000 Image Compression (Lossless Only) / … with RPCL Options (Lossless Only) / High-Throughput JPEG 2000 Image Compression
JPEG XL lossless / recompression / lossy.110 / .111 / .112JPEG XL Lossless / JPEG XL JPEG Recompression / JPEG XL
J2K lossless/lossy.90 / .91JPEG 2000 Image Compression (Lossless Only) / JPEG 2000 Image Compression
JPEG-LS lossless / near-lossless.80 / .81JPEG-LS Lossless / JPEG-LS Lossy (Near-Lossless)

A deployment intending interactive streaming should specify .202 rather than HTJ2K generally, and ensure tile length markers are present; HTJ2K also requires a CAP marker segment with the P15 flag. JPEG XL’s recompression syntax (.111) re-wraps an existing baseline-JPEG archive losslessly without a pixel round trip, the migration path for JPEG-native fleets. A compatibility matrix for specific archives, viewers, and PACS requires product-level input and is out of scope.

Two Architectures

Figure 7. The two candidate architectures. The distinction is where a codestream-family boundary requires a full decode and re-encode rather than a compressed-domain transcode.

Architecture A: HTJ2K/J2K as master. Canonical storage for hot and cold tiers is HTJ2K, where “cold” is a cheaper storage class for the same codestream, not a different codec. Classic J2K stays reachable by compressed-domain transcode where its 7-9% ratio advantage outweighs speed. Lossy HTJ2K (.203) for the interactive path is supported directly by the matched-ratio data: at ~10.5× it decoded 2.0× faster than JPEG XL for 2.9 SSIMULACRA2 points. JPEG XL is a one-way derived artifact: a viewer-delivery rendition, and separately tuned derivatives for inference and QC through Unifier AI Conductor. JPEG-LS has no role except where a legacy archive already exists.

Architecture B: JPEG XL as master. Lossless JPEG XL at acquisition (vendor-announced, with availability depending on region and intended use) or at ingest; best lossless ratio on every tile. Two conditions must hold together: encode cost absorbed off the critical viewing path (a horizontal-capacity requirement of ~78-95× at effort 7, or ~13× at effort 3 as measured at 4096px), and viewing served by a supported direct JPEG XL viewer or a bounded derived HTJ2K rendition cache. Native JPEG XL acquisition may reduce conversion work but is not required; JPEG XL can also be encoded at ingest. Where they do not, what remains is Architecture A with a different master and a larger encode bill. For both: ingest encoding is asynchronous and parallelizable; decode is synchronous and latency-bound. Post-receive rather than on-the-fly transcoding gives predictable load and simpler retry.

Licensing

ImplementationTermsMeasured / practical
HTJ2K-KakaduCommercially licensedReference implementation; the build benchmarked here [5]
HTJ2K-OpenJPHBSD-2-ClauseBit-exact vs Kakadu 6/6; 8.9-10.5× slower to encode than 8-thread Kakadu (3.6-3.8× per core); no thread option by design; no JPIP server; one contributor holds 96% of commits. Still 2.3-2.8× faster than Kakadu’s classic J2K decode [29,30]
JPEG XL- libjxlBSD-3-Clause + royalty-free patent grantReference implementation of ISO/IEC 18181 [7]
HEVC/HEIC (excluded)Non-unified multi-pool royalties; 25% increase, deadline 30 June 2026 [10]DICOM does not permit motion-compression syntaxes for WSI; profile limited to 4:2:0 / 8-bit

Royalty-free licensing is no longer exclusive to JPEG XL: OpenJPH provides a royalty-free HTJ2K path, so a deployer requiring one is not obliged to select JPEG XL; rather, streaming, not licensing, is the deciding constraint.

Industry Adoption and Archive Scale

  • AWS HealthImaging stores most lossless image frames as HTJ2K with RPCL (.202) by default; some supported inputs retain their original transfer syntax, and a datastore can be configured for JPEG 2000 Lossless [43]. HTJ2K import for instances up to 4 GB (explicitly for pathology) since Mwarch 2024 [3]; lossy JPEG XL (.112) storage and retrieval without transcoding since 2 February 2026 [25]; lossless .110 is not on the supported-syntax list. NVIDIA nvImageCodec provides GPU-accelerated JPEG 2000/HTJ2K decode; AWS HealthImaging’s GPU path uses nvJPEG2000 [33].
  • Philips announced the Pathology Scanner SGi (8 September 2025) [34] with native DICOM JPEG and JPEG XL output, claiming files “up to 50% smaller” on preliminary test data. The announcement described the scanner as under development, not CE marked and not yet for sale; Philips’s current regional pages describe it as Research Use Only in the United States, with availability varying by country [44]. It demonstrates vendor direction, not production validation.
  • Archive scale: Memorial Sloan Kettering [31] reports 6.1M+ slides scanned and 9 PB allocated with equivalent redundancy at $1M per PB; the UK’s National Pathology Imaging Co-operative [36] reports 29 PB mirrored across 40 hospitals with ~3 PB of new images a year. At those scales, an 11-15% difference in lossless file size is a material capital figure.
  • Independent measurements: no peer-reviewed publication measures lossless JPEG XL on whole-slide imagery; the 1.78-2.45× here sits within the CVPR 2025 WISE [39] lossless envelope (PNG 1.95-4.81×, LZMA 2.28-9.18×, TCGA).

Return on Investment: HTJ2K and JPEG XL

Two costs recur: viewer decode compute and storage, and one is paid once: encode at ingest. Every figure below derives from this paper’s own Condition C/D measurements and bytes-weighted ratios across all six tiles, at illustrative rates ($0.34/hour for the 8-vCPU benchmark instance; $10/TB-month cold; $0.023/GB-month flat, decimal TB); substitute negotiated rates before deciding (Appendix K). HTJ2K encode times are lower bounds, so its ingest advantage is understated. All JPEG XL figures in these tables use effort 7, the only lossless operating point measured at both tile sizes; the provisional recommendation of effort 3 (lossless) and effort 5 (lossy) rests on 4096px measurements, so where effort-3 economics appear they are estimates and are labeled as such.

Ingest time and one-time encode cost (one 8-vCPU instance, 8192px tiles, ~4,970 tiles per raw TB)

CodecPer tile1 TB raw10 TB100 TB1 PBEncode cost / raw PB
HTJ2K215 ms18 min3.0 h29.6 h296 h$101
Classic J2K2,605 ms3.6 h35.9 h359 h3,594 h$1,222
JPEG-LS4,691 ms6.5 h64.7 h647 h6,472 h$2,200
JPEG XL lossless, e719,165 ms26.4 h264 h2,644 h26,443 h$8,990

Ingest parallelizes, so wall-clock divides by instance count; cost does not. HTJ2K migrates a 100 TB archive in a working week on one instance; JPEG XL needs ~110 instance-days for the same archive. Compressed-domain transcode preserves pixels and avoids a full decode and re-encode, but this study did not establish a lower production migration cost for J2K-to-HTJ2K conversion.

Storage per raw petabyte

CodecRatio (bytes-weighted)Stored per raw PBCold @ $10/TB-moFlat $0.023/GB-mo
HTJ2K1.92×520 TB$62.4k / yr$143.6k / yr
Classic J2K2.08×481 TB$57.7k / yr$132.7k / yr
JPEG-LS1.78×562 TB$67.4k / yr$155.1k / yr
JPEG XL lossless, e72.21×452 TB$54.3k / yr$124.8k / yr

HTJ2K stores 8.2% more than classic J2K. JPEG XL stores 13.1% less than HTJ2K and 5.9% less than J2K; JPEG-LS stores the most of the four.

Viewer decode computes the recurring cost that dominates

Scenario: 100 concurrent pathologist sessions, each requesting two 4096px tiles per second (200 tiles/s), in-memory decode, serialized per 8-vCPU instance:

CodecDecode per 4096px tileTiles / s per instanceInstancesAnnual compute
HTJ2K32.4 ms30.97$20.8k
Classic J2K652.4 ms1.5131$390.2k
JPEG XL lossless, e7780.3 ms1.3157$467.6k

Absolute counts are illustrative and conservative; production serving parallelizes across processes, and viewers request smaller tiles than were measured (an open item). The ratios are what carry: they are the measured 20-24× in-memory decode multiples.

Net position per raw petabyte, ten-year horizon

 HTJ2K as viewing master (vs classic J2K)JPEG XL as archive tier (vs HTJ2K)
Recurring benefitViewer compute: ~$369k / yr saved in the scenario aboveStorage: 68 TB / PB → $8.2k / yr cold, $81.8k over ten years
Recurring costStorage +8.2%: 39 TB / PB → $4.7k / yr coldRetrieval into the HTJ2K viewing tier: decode 3.08 s + re-encode 0.21 s per 8192px tile ≈ $0.00031 per tile
One-time costEncode: $101 / PB; transcode migration cost not quantified in this studyEncode: +$8.9k / PB over HTJ2K
Break-evenIn dollars: one full archive read at 4096px saves ~$1,163 of decode compute against ~$4.8k / yr of extra storage, ~4.1 full archive reads per year; a pathologist’s view is a partial read234M tile retrievals per PB over ten years ≈ 4.7 full archive reads per year
VerdictLatency-driven, not storage-driven, the 8.2% premium is repaid by decode compute only above ~4 full reads/yr; the case is 20× faster tile decode and 11-13× faster ingestPositive for a genuinely cold tier; a tier read end-to-end more than ~4-5× a year should stay HTJ2K

Break-even, in dollars. A percentage speedup divided by a percentage storage overhead does not establish payback; the comparison has to be dimensioned. HTJ2K over classic J2K: one full read of a raw petabyte at 4096px saves ~$1,163 of decode compute, while the 8.2% storage premium costs ~$4.8k per year at cold rates, so decode compute alone repays it only above ~4.1 full archive reads per year. HTJ2K’s case for the viewing tier is latency and ingest throughput, not storage dollars. JPEG XL as archive over HTJ2K is beneficial when storage saving × years > encode delta + retrieval cost × reads. Against classic J2K as the cold tier, JPEG XL’s saving is 29 TB / PB; whether retrieval into HTJ2K is cheaper from J2K by compressed-domain transcode than from JPEG XL was not established on this instance (Appendix K). Encoder effort follows the same arithmetic effort: 1→3 is favorable ~70×, effort 7→9 unfavorable ~8×; the quantitative basis for the effort caps is in Appendix K.

Migrating an existing JPEG-LS archive to JPEG XL

JPEG-LS shares no codestream structure with JPEG XL or HTJ2K, so leaving it is a full decode and re-encode; no compressed-domain path exists, and JPEG XL’s recompression syntax covers baseline DCT JPEG only, not JPEG-LS. The migration is a one-time, fully parallel batch job whose cost is set by the target encoder:

Step (8192px tiles, ~4,970 per raw TB)Per tileCompute per raw PB
JPEG-LS decode (Condition B)

~3.9 s

~$1.8k
JPEG XL lossless encode, effort 3~3.2 s~$1.5k
JPEG XL lossless encode, effort 7 (Condition D)~19.2 s~$9.0k
Migration total, effort 3 / effort 7 ~$3.3k / ~$10.8k

Effort 3 at 8192px is estimated from the 4096px sweep (about one sixth of effort 7’s time); every other figure is measured. About 410 instance-days per raw PB at effort 3, dividing by instance count.

Against that one-time cost, JPEG-LS stores 562 TB per raw PB where JPEG XL stores 452 TB: 110 TB saved, about $13.2k per year at cold rates; payback about ten months at effort 7 (measured) and roughly three months at effort 3 (an estimate, effort-3 8192px encode times and sizes were not measured, and its 4096px ratios run 1-3% below effort 7), and decode after migration is 12-14% faster, not slower (JPEG XL 857 vs JPEG-LS 974 ms at 4096px, Condition B). For sufficiently large JPEG-LS archives with meaningful remaining retention, migration can pay back on the measured compute-only arithmetic. Small or near-expiry archives may be better retained, and deployment-specific migration, validation, and operating costs must be factored in before making a decision.

Where the conversions run, every figure above assumes the conversions happen somewhere: ingest/encode, J2K↔HTJ2K compressed-domain transcode, JPEG XL derivation for the archive and delivery tiers, migration of a legacy JPEG-LS or baseline-JPEG archive. In a Unifier deployment, that place is the normalization step: Unifier selects the path per source (compressed-domain transcode where the codestream family allows it, the recompression syntax for baseline-JPEG sources, full decode and re-encode where nothing cheaper exists), runs it post-receive off the viewing path, and carries the resulting transfer syntax through to the PACS, the viewer, and Unifier AI Conductor. The model is codec-agnostic; the adapter removes the need to build and operate a separate pipeline for each conversion the model assumes.

Recommendations

  • Existing HTJ2K/J2K infrastructure: retain Architecture A HTJ2K as canonical master for hot and cold tiers, differentiated by storage class. Cold tier: JPEG XL where read rarely; classic J2K where read back into the interactive path often. Specify .202 where interactive streaming is required.
  • Greenfield: the decision turns on streaming, not compression. Where interactive review through a streaming viewer is required, select HTJ2K as master; JPEG XL as master is defensible where both conditions in the summary hold.
  • Mixed legacy fleets: let the native source format choose the target J2K-native scanners into HTJ2K by compressed-domain transcode; baseline-JPEG scanners losslessly into JPEG XL via the recompression syntax; iSyntax has no inexpensive path into either.
  • Lossy compression: do not adopt a ratio from this paper or any other. As a starting point for a validation study rather than a production setting, JPEG XL distance 1.0 at effort 5 is where this data would begin.
  • JPEG-LS: do not select it for new deployments. For an existing JPEG-LS archive, migration to JPEG XL is a full re-encode costing roughly $3-11k of compute per raw petabyte against ~$13k per year of storage saved, a compute-only payback inside a year at effort 7. Include validation and operating costs before deciding; small or near-expiry archives may be better retained.
  • When evaluating benchmarks, including this one, verify against your own stain distribution and scanner fleet. A benchmark that does not disclose thread configuration, tissue regions, I/O path, and encoder operating point should be treated as unverified; the cheap control is a codec that cannot be affected by the variable under test, plus output bytes ÷ elapsed time for every series.

Conclusion

  1. HTJ2K’s speed advantage is large and is based on validated measurements: 6.4-8.3× faster than classic J2K decoding to file, 17.9-24.6× faster decoding into memory, and at least 11.0-13.5× faster encoding.
  2. JPEG XL produced the best archival compression, achieving 12-18% higher ratios than HTJ2K on every tile, at ≥ 78-95× the encoding cost. Effort 3 (lossless) and 5 (lossy) are engineering guidance pending task-specific validation.
  3. JPEG-LS has no role in the recommendation. It never produced the smallest file; classic J2K and JPEG XL beat it on every tile; it edged HTJ2K on ratio only on the two TCGA tiles and fell to 1.61-1.64× on IHC; and it decoded 9.9-11.1× slower than HTJ2K. The archive tier it would conventionally occupy goes to JPEG XL.
  4. Compressed-domain HTJ2K↔J2K transcoding resolves backward compatibility, with the threading caveat stated in full.
  5. Streaming is the deciding constraint, a standardized profile versus a codec capability. HTJ2K has a DICOM-standardized RPCL and tile-marker profile, as well as JPIP-referenced syntaxes. AWS HealthImaging stores most lossless frames in that profile by default. JPEG XL has progressive decoding in the codec, with no medical viewer or DICOM delivery path verified to use it, and is used alongside cloud storage for its lossy form.
  6. Royalty-free licensing is no longer exclusive to JPEG XL: OpenJPH is a BSD-2-Clause HTJ2K path, bit-exact against Kakadu, with per-core encode latency at 3.6-3.8× that of Kakadu, yet still 2.3-2.8× faster than Kakadu’s classic J2K decode.
  7. Unifier is positioned codec-agnostically across both architectures. Whichever master a deployment selects, the normalization and routing layer is what reaches it and absorbs a mix of legacy fleets.

On method. The most consequential findings here were not about codecs: two published measurements recorded storage throughput, the errors were invisible in output that looked consistent, and both penalized the fastest codec. Both controls are fully documented in the Appendix.

Online Appendix: A Test data and region selection (Fig. 2) · B Environment, versions, drift, governor status · C Protocol, threading, correctness, sanity guards · D The decode artifact · E Lossless full tables (Fig. 3) · F Lossy full tables (Fig. 4, 6) · G Decode latency consistency · H Ratio-matched lossy, Butteraugli 8192px, baseline JPEG · I JPEG XL effort sweep (Fig. 5) · J Encode artifact (Fig. 9), parameter sensitivity, transcode benchmark · K Storage economics · L Verification log · M Open items · N References (44).