Entropy Coding, Non-Linear LUT Quantization & Wavelet RAW
An authoritative information-theory dissertation on camera RAW compression algorithms. We dissect Uncompressed 14-bit packing vs. Lossless Huffman/LZW prediction coding, explain how Lossy Compressed RAW uses photon-shot-noise square-root Lookup Tables (LUTs), and analyze modern Wavelet/Sub-band codecs like Nikon High-Efficiency N-RAW (intoPIX TicoRAW) and Canon C-RAW.
When configuring the File Format menu on a modern 45MP, 50MP, or 61MP mirrorless camera (such as a Sony A1 / A7R V, Nikon Z8 / Z9, Canon EOS R5 Mark II, or Fujifilm GFX 100 II), photographers are confronted with three or four cryptic RAW recording options: Uncompressed RAW, Lossless Compressed RAW, Compressed / C-RAW, and High-Efficiency (HE / HE*) RAW.
Choosing the wrong setting can either bloat your storage RAID arrays with tens of terabytes of zero-information padding bits and choke your continuous burst buffer after 2 seconds, OR introduce subtle highlight reconstruction artifacts across high-contrast edges! In this technical deep dive, we dissect the exact mathematical algorithms inside every tier of RAW compression.
1. Uncompressed RAW vs. Lossless Compressed RAW: Why They Are Bit-for-Bit Identical!
First, let us dispel a costly myth that causes thousands of studio and landscape photographers to waste 40% of their hard drive and CFexpress card capacity: there is ZERO image quality, dynamic range, or bit-depth difference between “Uncompressed RAW” and “Lossless Compressed RAW”! When decoded into memory by Adobe Camera Raw, Capture One, or LibRaw, the resulting 14-bit mosaic integer array is 100% mathematically bit-for-bit identical!
How does Lossless Compressed RAW shrink a 90 MB Uncompressed 45-megapixel RAW file down to ~50 MB without losing a single photon of data? Through two classic lossless information-theory steps (analogous to ZIP or FLAC audio compression):
- Spatial Differential Prediction (DPCM — Differential Pulse-Code Modulation): In any natural photograph (especially across smooth skies, walls, out-of-focus bokeh, or studio backdrops), adjacent same-color Bayer pixels (e.g., Green pixel
G_1and its neighborG_2two columns over) have nearly identical brightness values! Instead of storing two massive 14-bit numbers like[12450, 12452], the lossless encoder predicts thatG_2will equalG_1and stores only the tiny Prediction Difference (Residual Error):+2! - Variable-Length Entropy Coding (Huffman / Golomb-Rice Coding): Once the entire image is converted into a matrix of tiny spatial difference numbers clustered tightly around
0, ±1, ±2, ±3, a Huffman entropy coder assigns ultra-short 2-bit and 3-bit binary codes to those common small numbers instead of wasting a full 14 bits or 16 bits per pixel!
When Is the ONLY Time Uncompressed RAW Has an Advantage?
Not for image quality—only for CPU/ISP processing latency on older cameras! Because encoding and decoding Huffman bitstreams requires CPU cycles, a decade-old DSLR or an entry-level computer might open Uncompressed RAW files 0.1 seconds faster in thumbnail view. On modern processors with hardware decompression blocks, Lossless Compressed RAW is strictly superior in every metric (smaller files, faster card write times, and deeper burst buffers).
2. Classic Lossy “Compressed RAW”: Exploiting Photon Shot Noise via Square-Root LUTs
What about traditional “Compressed RAW” (such as Nikon’s classic 12-bit/14-bit “Compressed NEF” or Sony’s original “Compressed ARW”)? Unlike Lossless Compressed RAW, these formats are mathematically lossy—yet they achieve a remarkable feat: reducing a 14-bit value (16,384 levels) down to an 11-bit or 10-bit code word (1,024 to 2,048 levels) with almost zero visible loss in shadow dynamic range! How is that physically possible?
As we proved in our Camera Sensor Dynamic Range dissertation, bright highlights contain massive Photon Shot Noise equal to the square root of the signal (σ_shot = √S):
- If a bright highlight pixel captures 10,000 electrons, the random natural Poisson photon shot noise is
√10,000 = ±100 electrons! - Because nature’s own random photon noise makes any two values between
9,950and10,050statistically indistinguishable, recording every single integer step (10001, 10002, 10003...) in the bright highlights is pure wasted data—you are merely recording random quantum static at high precision! - The Non-Linear Tone Mapping Lookup Table (LUT): Classic Lossy Compressed RAW preserves every single 14-bit integer step (
0, 1, 2, 3... 512) untouched in the deep shadows (where read noise is tiny and every code value counts for +4 EV shadow recovery!), and progressively widens the quantization steps in the midtones and highlights proportional to√Signal! Upon opening the file in Lightroom, an inverse Lookup Table expands the numbers back to a 14-bit linear scale.
3. Next-Gen Wavelet RAW: Canon C-RAW and Nikon High-Efficiency (intoPIX TicoRAW)
When 45MP to 61MP stacked CMOS cameras began shooting at 20 to 30 frames per second (generating over 1,800 Megabytes per second of raw sensor data!), camera engineers needed a revolutionary compression architecture that could shrink 60 MB RAW files down to 15 MB to 25 MB with visually lossless fidelityeven when pushing shadows by +4 EV stops.
Enter Sub-Band Wavelet RAW Compression—spearheaded by Canon C-RAW (CR3) and Nikon High-Efficiency RAW (powered by intoPIX TicoRAW IP cores inside the EXPEED 7 processor):
- How TicoRAW / Wavelet Sub-Band Coding Works: Before demosaicing, the encoder separates the four Bayer color planes (
R, G1, G2, B) into four independent monochrome sub-images and applies a line-based Discrete Wavelet Transform (DWT), splitting the sensor data into low-frequency base luminance and high-frequency detail sub-bands. - Visual Losslessness Above the Noise Floor: By dynamically quantizing the high-frequency wavelet coefficients just below the sensor’s physical photon-shot-noise floor at each specific ISO setting, Nikon’s High-Efficiency★ (HE★) mode compresses a 55 MB 45.7-megapixel Z8/Z9 file down to ~32 MB (a 42% reduction) with zero perceptible difference in 400% pixel-peeping or +4 EV shadow pushes! Even the more aggressive HE mode (~20 MB per 45MP RAW file) retains full 14-bit shadow recovery, enabling continuous 20 fps RAW bursts for over 1,000 consecutive frames!
4. Camera RAW Compression Formats Benchmark Matrix
The comparative file sizes, compression ratios, mathematical reversibility, and artifact profiles across major camera RAW compression modes (normalized to a 45–50MP Full-Frame sensor) are detailed below:
| RAW Recording Mode | 45MP File Size | Compression Ratio | Mathematical Fidelity | Artifact Profile Under Extreme +4 EV Edit | Recommended Professional Use Case |
|---|---|---|---|---|---|
| Uncompressed 14-Bit RAW | 85 MB – 95 MB | 1.0 : 1 (None) | 100% Bit-Exact | None (Pure linear ADC integer dump) | Legacy software / zero-CPU-overhead archiving |
| Lossless Compressed 14-Bit RAW | 48 MB – 58 MB | 1.6 : 1 to 1.8 : 1 | 100% Bit-Exact | None (Identical to Uncompressed RAW) | Studio commercial, fine-art landscape, Astro |
| Nikon High-Efficiency★ (TicoRAW) | 30 MB – 34 MB | 2.8 : 1 | Visually Lossless | Imperceptible (Quantized below shot-noise floor) | All-around professional wedding, wildlife & action |
| Canon C-RAW (.CR3) / Nikon HE | 18 MB – 24 MB | 4.0 : 1 | Lossy Wavelet | Virtually none; minor noise-floor smoothing at +5 EV | 20–30 fps sports bursts, high-volume event work |
| Sony Classic Compressed RAW (11+7) | 45 MB (Fixed) | 2.0 : 1 (Block) | Lossy Block DPCM | Can show star-eating or edge artifacts on high-contrast lines | Superseded by Sony Lossless Compressed M/S/L |
5. Forensic Dissection: Why Sony’s Legacy 11+7 Lossy Compressed RAW Caused Artifacts
For nearly a decade before Sony introduced true Lossless Compressed RAW on its Alpha flagship bodies (A1, A7 IV, A7R V, A9 III), photographers noticed that Sony’s classic “Compressed RAW (.ARW)” produced visible posterization and jagged magenta/cyan ghost fringes along extreme high-contrast edges (such as dark tree branches silhouetted against a bright sunset sky, or star fields in astrophotography). Why did Sony’s legacy lossy algorithm produce visible artifacts when Nikon’s lossy compressed NEF and Canon’s C-RAW did not?
Let us inspect the exact binary packet structure of Sony’s legacy 11+7 Block Delta Compression:
- Step 1 — Non-Linear 14-Bit to 11-Bit Tone Curve: First, the 14-bit linear ADC output (
0 to 16,383) is mapped through a non-linear lookup table down to an 11-bit number (0 to 2,047). - Step 2 — The Fatal 16-Pixel Horizontal Strip Packet: Next, the encoder grabs a horizontal row of 32 consecutive Bayer pixels (which contains 16 same-color pixels, e.g., 16 Green pixels spanning 32 columns). Inside that 16-pixel strip, the encoder identifies the Single Minimum Pixel Value (11 bits) and the Single Maximum Pixel Value (11 bits), and stores the remaining 14 pixels in that strip as 7-bit relative offsets (
0 to 127) scaled strictly between the local Minimum and Maximum of that 16-pixel strip! - Why Extreme Contrast Edges Break the 7-Bit Delta Strip: As long as all 16 pixels in a horizontal strip have similar brightness (such as a smooth sky or skin tone), the gap between Minimum and Maximum is tiny, so 7 bits (128 steps) provides full 11-bit precision. However, if a razor-sharp silhouette edge (like a dark building roof or tree twig at code value
100against a bright sun disc at code value16,000) crosses that 16-pixel horizontal strip, the span between Minimum and Maximum explodes to the entire 14-bit dynamic range! Suddenly, the other 14 pixels in that horizontal strip have only 7 bits (128 coarse steps!) to represent the entire tonal scale—causing visible horizontal dash-line artifacts and color shifts extending up to 16 pixels outward from the high-contrast edge!
This forensic example illustrates why modern 2D Sub-Band Wavelet RAW codecs (like Nikon TicoRAW and Canon CR3 C-RAW) and True Lossless Compressed RAW have completely superseded fixed-length 1D strip delta encoding.
6. Apple ProRAW, JPEG-XL (.JXL) Inside DNG, and Computational Multi-Frame RAW
In recent years, a third category of “RAW” container has emerged across both computational systems and modern Adobe DNG 1.7 workflows: Linear Demosaiced Multi-Frame RAW compressed with JPEG-XL (`.JXL`):
- How Computational Multi-Frame RAW (Apple ProRAW / Pixel RAW / Hasselblad Multi-Shot) Differs from Optical Single-Shot Bayer RAW: When a computational camera captures a ProRAW DNG, it actually fires a high-speed burst of 8 to 12 bracketed underexposed and base-exposed frames, aligns them sub-pixel by sub-pixel, merges their photon counts to suppress read noise (increasing effective Full-Well Capacity), and outputs an already-demosaiced 3-channel 12-bit or 16-bit Linear DNG with semantic tone-map gain tables embedded as metadata!
- JPEG-XL (ISO/IEC 18181) Compression Inside DNG 1.7: Because an uncompressed 48-megapixel 3-channel Linear DNG weighs an unwieldy 180 to 250 Megabytes, the DNG 1.7 specification integrates JPEG-XL Modular Lossless and Visually Lossless compression directly inside the `.DNG` wrapper! Using JPEG-XL lossless compression shrinks a 190 MB Linear DNG down to ~65 MB (and visually lossless JPEG-XL shrinks it down to ~18 MB to 25 MB) while retaining full 16-bit linear floating-point dynamic range for highlight and shadow sliders in Lightroom!
7. CFexpress Sustained Write Speeds, Buffer Depth, and Bit-Rate Math
When configuring your camera’s RAW compression setting for sports, wildlife, aviation, or wedding action photography, your choice directly dictates your camera’s Continuous Burst Buffer Depth and memory card bandwidth requirements. Let us calculate the exact real-time data throughput of a 45.7-megapixel full-frame camera shooting at 20 frames per second:
- Shooting Uncompressed 14-Bit RAW (90 MB/frame × 20 fps): Generates a staggering
1,800 MB/sec (1.8 GB/s)data stream! Even a top-tier CFexpress Type B card with a sustained write speed of1,300 MB/seccannot keep up—filling the camera’s internal RAM buffer in ~3.5 seconds (70 frames) and stalling the shutter! - Shooting Lossless Compressed 14-Bit RAW (52 MB/frame × 20 fps): Generates
1,040 MB/sec—allowing a fast CFexpress Type B card (sustained write ≥ 1,200 MB/s) to clear the buffer in real time with zero image quality loss! - Shooting High-Efficiency★ / C-RAW (28 MB/frame × 20 fps): Drops the data stream to just
560 MB/sec! The camera can shoot 20 fps continuously until the 512 GB card is completely full, while cutting studio NAS backup and cloud sync times in half!
Downsampled RAW Modes (Lossless Compressed M & S RAW):
Many high-resolution 50MP–61MP bodies (such as the Sony A7R V, A1, and Canon EOS R5) also offer Medium (26MP) and Small (15MP) Lossless Compressed RAW modes. Unlike true single-channel Bayer mosaic RAW, downsampled M and S RAW modes perform an in-camera bilinear or bicubic demosaic-and-downsample operation into a compact 14-bit linear YCbCr or RGB array. While convenient for high-volume event reporting where 61 megapixels is overkill, downsampled M/S RAW files cannot take full advantage of raw-mosaic optical corrections or raw-domain AI denoising—making full-resolution High-Efficiency Wavelet RAW / C-RAW the superior engineering choice when smaller file sizes are needed.
Master RAW Compression Decision Matrix by Genre
1. Commercial Studio, Architecture, Fine-Art Landscape & Astrophotography: Always select 14-Bit (or 16-Bit) Lossless Compressed RAW. Never use Uncompressed RAW (which wastes 40% disk space for zero bit difference), and avoid lossy modes when doing extreme star-field calibration or multi-stop bracket merges.
2. Wedding, Documentary, Corporate Events & Portrait Sessions: Select Lossless Compressed RAW or High-Efficiency★ (HE★).
3. 20–30 fps Wildlife, Bird-in-Flight & Action Sports: Select Nikon HE★ / Canon C-RAW / Sony Lossless M or Compressed to maximize burst buffer depth and cut culling/ingest time by 50%.

