DICOM Compression: JPEG 2000 vs JPEG-LS vs HTJ2K
- A DICOM compression transfer syntax UID tells the receiver which codec to use to decompress pixel data.
- Lossless compression guarantees byte-for-byte reconstruction and typically shrinks files by a factor of 2:1 to 4:1.
- JPEG-LS decodes 4 to 5 times faster than JPEG 2000 but does not support progressive resolution rendering.
- HTJ2K decodes 6 to 10 times faster than classic JPEG 2000 while keeping progressive streaming for web viewers.
- Open-source libraries like pydicom and DCMTK rely on external plugins to decode each compression codec.
DICOM compression transfer syntaxes define how medical image pixel data is compressed and encapsulated inside a DICOM dataset. A compression transfer syntax is a standardized Unique Identifier (UID) that tells the receiver which decompression algorithm to apply to the pixel data element.
When you build a cloud PACS, an artificial intelligence (AI) pipeline, or a web viewer, transfer syntaxes dictate transfer speeds, storage costs, and CPU bottlenecks. Choosing the right compression strategy helps you ingest high-volume hospital studies without stalling your servers.
What is a DICOM compression transfer syntax?
A DICOM compression transfer syntax specifies the codec used to compress Pixel Data (7FE0,0010) and how those compressed bytes sit inside the file. Uncompressed DICOM files store pixels as raw raster arrays in Native format. In contrast, compressed transfer syntaxes wrap the encoded bitstream in Encapsulated format, as defined in PS3.5 Section 8.2.
Encapsulated pixel data splits the compressed bitstream into fragment items. The element starts with a Basic Offset Table item (FFFE,E000), contains 1 or more pixel fragments, and ends with a Sequence Delimitation Item (FFFE,E0DD).
During network association negotiation, the sending modality and your receiver must agree on a matching transfer syntax. If your receiver only advertises uncompressed syntax and the hospital PACS only sends compressed data, the connection drops immediately. To understand how negotiation pairs transfer syntaxes with data types, read our guide on DICOM SOP classes and transfer syntaxes.
Why does lossless compression matter in medical imaging?
Lossless compression is required for primary diagnostic imaging because it guarantees byte-for-byte reconstruction of original scanner pixel values. Lossy compression permanently discards subtle contrast variations that clinical radiologists rely on to detect microcalcifications or faint lesions.
Regulatory standards and hospital risk policies prohibit lossy compression for diagnostic ingestion. If your software alters pixel values during intake, you create clinical liability and risk diagnostic errors.
Lossless codecs reduce raw medical images by a factor of 2:1 to 4:1. A 1,000-slice computed tomography (CT) scan takes 500 megabytes uncompressed. Lossless compression shrinks that to 150 megabytes without losing a single pixel value.
How do JPEG 2000, JPEG-LS, and HTJ2K compare?
Use JPEG 2000 for legacy hospital PACS. Use JPEG-LS for fast backend decompression on your servers. Use HTJ2K for modern web viewing.
The 3 dominant modern codecs differ in compression ratios, algorithmic complexity, and decoding throughput:
| Codec | DICOM Transfer Syntax UID | Standard | Decode Speed | Web Streaming |
|---|---|---|---|---|
| JPEG 2000 Lossless | 1.2.840.10008.1.2.4.90 |
ITU-T T.800 | Slow (baseline) | Progressive |
| JPEG-LS Lossless | 1.2.840.10008.1.2.4.80 |
ITU-T T.87 | Fast (4x to 5x JPEG 2000) | No |
| HTJ2K Lossless | 1.2.840.10008.1.2.4.201 |
ITU-T T.814 | Fastest (6x to 10x JPEG 2000) | Progressive |
JPEG 2000 (Part 1)
JPEG 2000 uses wavelet transforms and an arithmetic block coder called EBCOT (Embedded Block Coding with Optimized Truncation). It achieved widespread adoption across enterprise PACS archives in the 2000s because it offers progressive resolution decoding and high compression ratios.
The major drawback of JPEG 2000 is decoding speed. EBCOT requires heavy sequential bit-plane processing that stalls CPU cores. Decompressing thousands of CT or magnetic resonance (MR) slices in a cloud worker consumes significant CPU cycles and delays AI model execution.
JPEG-LS
JPEG-LS is based on the LOCO-I (Low Complexity Lossless Compression for Images) algorithm developed by Hewlett-Packard. It uses simple predictive modeling with run-length coding and Golomb-Rice adaptive entropy coding.
Because JPEG-LS avoids complex wavelet transforms, it decodes 4 to 5 times faster than JPEG 2000 on standard CPUs. It produces equal or superior compression ratios on 12-bit and 16-bit CT scans. However, JPEG-LS does not support resolution scaling or progressive rendering, which limits its utility for interactive browser viewers.
High-Throughput JPEG 2000 (HTJ2K)
High-Throughput JPEG 2000 (HTJ2K) was standardized in 2019 as JPEG 2000 Part 15 (ITU-T T.814) and added to DICOM via Supplement 235. HTJ2K replaces the slow EBCOT block coder with FBCOT (Fast Block Coder with Optimized Truncation).
FBCOT decodes pixels using vector instructions and parallel bit processing. HTJ2K decodes 6 to 10 times faster than classic JPEG 2000 while preserving full compatibility with the JPEG 2000 file family and progressive resolution streaming. Web viewers like OHIF and Cornerstone3D use WebAssembly builds of HTJ2K decoders to render volumetric studies at interactive frame rates.
Which decoders do software libraries provide?
Open-source DICOM libraries do not bundle every codec directly in their core parser. Most libraries delegate pixel decompression to external C or C++ codecs.
In Python with pydicom, calling dataset.pixel_array raises an error if the codec library is missing. You must install dedicated plugins for each codec:
- JPEG 2000: Decoded via
pylibjpegwith thepylibjpeg-openjpegplugin, or throughimagecodecs. - JPEG-LS: Decoded via
pylibjpegwith thepylibjpeg-libjpegplugin (wrapping the CharLS library). - HTJ2K: Decoded using the
openjphPython bindings or OpenJPEG builds supporting Part 15.
In C++ and Go server environments, DCMTK supports JPEG-LS via its dcmdjpls module and JPEG 2000 via external plugins. Web browsers decompress HTJ2K using WebAssembly compilations of OpenJPH, which runs fast enough to decode CT slices on background web workers.
What should your ingestion pipeline accept and store?
A reliable cloud ingestion pipeline separates its network reception contract from its internal storage format.
When receiving studies from hospital modalities, your listener must accept what the hospital sends. Many hospital modalities only support Explicit VR Little Endian (1.2.840.10008.1.2.1), legacy JPEG Lossless Process 14 (1.2.840.10008.1.2.4.70), or classic JPEG 2000 (1.2.840.10008.1.2.4.90). Older scanners will not negotiate HTJ2K because their DICOM software pre-dates Supplement 235.
Negotiating presentation contexts with varied hospital scanners requires maintaining reliable DICOM listeners and certificates. To avoid running internet-facing DICOM listeners across hospital networks, Dicomly terminates the association for you. It streams the original DICOM dataset to your application over HTTPS via DICOMweb STOW-RS. That lets your team focus on decoding pixels and running inference instead of managing DIMSE networking.
Once files arrive inside your cloud boundary, you have two architectural options for storage:
- Store untouched original bitstreams: Keep the exact transfer syntax received from the hospital. This eliminates transcoding CPU costs and avoids any dispute over byte modification during clinical audits.
- Transcode to HTJ2K for web streaming: If your product serves an interactive diagnostic viewer, transcode incoming studies to HTJ2K Lossless (
1.2.840.10008.1.2.4.201) asynchronously. Your viewer downloads progressive resolution tiles directly from object storage without server-side decompression.
Never transcode from a lossy format to a lossless syntax, as this inflates file size without restoring lost clinical detail.
What to test first in your development lab
Before deploying your ingestion endpoint to production, test how your backend handles diverse transfer syntaxes.
Download sample DICOM studies encoded in uncompressed Explicit VR Little Endian, JPEG 2000 Lossless, and JPEG-LS. Run your data loader against each file and measure memory usage and execution time. To set up a repeatable testing environment with local modalities, follow our guide on building a local DICOM test lab with Docker.
Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →