Papers
Topics
Authors
Recent
Search
2000 character limit reached

RAWIC: Bit-Depth Adaptive Lossless Raw Image Compression

Published 30 Mar 2026 in cs.CV | (2603.28105v1)

Abstract: Raw images preserve linear sensor measurements and high bit-depth information crucial for advanced vision tasks and photography applications, yet their storage remains challenging due to large file sizes, varying bit depths, and sensor-dependent characteristics. Existing learned lossless compression methods mainly target 8-bit sRGB images, while raw reconstruction approaches are inherently lossy and rely on camera-specific assumptions. To address these challenges, we introduce RAWIC, a bit-depth-adaptive learned lossless compression framework for Bayer-pattern raw images. We first convert single-channel Bayer data into a four-channel RGGB format and partition it into patches. For each patch, we compute its bit depth and use it as auxiliary input to guide compression. A bit-depth-adaptive entropy model is then designed to estimate patch distributions conditioned on their bit depths. This architecture enables a single model to handle raw images from diverse cameras and bit depths. Experiments show that RAWIC consistently surpasses traditional lossless codecs, achieving an average 7.7% bitrate reduction over JPEG-XL. Our code is available at https://github.com/chunbaobao/RAWIC.

Summary

  • The paper presents RAWIC, a unified codec that adaptively compresses raw images using bit-depth conditioning to handle sensor disparities.
  • It employs patchwise processing and channel autoregression to capture intra-image variations, achieving up to 7.7% bitrate savings compared to JPEG-XL.
  • RAWIC proves broadly applicable across diverse sensors and bit depths, though its higher computational overhead indicates a need for runtime optimization.

RAWIC: Bit-Depth Adaptive Lossless Raw Image Compression

Introduction

Lossless compression of raw images is a significant challenge due to large file sizes, variable bit depths (commonly 10โ€“14 bits), and transformative sensor-specific characteristics. Unlike standard 8-bit sRGB images, raw sensor data preserves linear scene radiance and higher information fidelity, crucial for imaging pipelines and advanced vision tasks such as denoising, super-resolution, and low-light enhancement. This paper, "RAWIC: Bit-Depth Adaptive Lossless Raw Image Compression" (2603.28105), introduces a unified learned lossless codec (RAWIC) designed to effectively compress raw Bayer-pattern images from heterogeneous sensors and with disparate bit depths.

Limitations of Existing Methods

Conventional learned lossless image compression is predominantly tailored to 8-bit per channel sRGB images. Attempts to compress or reconstruct raw data via sRGB conversion, inverse ISP, or lossy surrogates introduce radiometric non-linearities and dependence on camera-specific assumptions, often necessitating separate models for different sensors and bit depths. Existing lossless learned codecs also assume fixed-bit distributions and cannot exploit intra-image bit-depth variations, leading to inefficiency and redundancy. Such limitations hinder scalability and generality for practical applications in computational photography and visual computing.

RAWIC Framework

RAWIC deploys a novel, bit-depth-adaptive entropy modeling architecture, achieving lossless coding with high efficiency and robustness to camera models:

  • Bayer Pattern Handling: Each raw image is converted from single-channel Bayer to a four-channel RGGB structure, preserving channelwise spatial fidelity.
  • Patchwise Processing: Images are partitioned into non-overlapping spatial patches, and per-patch bit depths are computed, capturing both inter-image and intra-image bit-depth variations.
  • Bit-Depth Embedding: Bit depths are used as auxiliary conditioning signals; embedded and fed into both encoder and entropy model modules.
  • Adaptive Entropy Model: RAWIC extends the ELIC hyperprior-based framework with bit-depth-adaptive entropy modeling. The conditional probability of each pixel within each patch is modeled with a mixture of logistics, where valid support is dynamically masked according to patch bit depth.
  • Channel Autoregression: Channel dependencies in RGGB data are captured via conditional likelihood factorization: p(xr)p(x^\text{r}), p(xg1โˆฃxr)p(x^{g_1}|x^\text{r}), p(xg2โˆฃxr,xg1)p(x^{g_2}|x^\text{r}, x^{g_1}), p(xbโˆฃxr,xg1,xg2)p(x^\text{b}|x^\text{r}, x^{g_1}, x^{g_2}), with mixture means autoregressively modulated.
  • Single Model for All Sensors and Depths: A unified model accommodates images from different sensors and arbitrary bit depths, contrary to previous approaches that require multiple models.

Quantitative Results

RAWIC demonstrates consistent bitrate savings over traditional and learned codecs across diverse datasets:

  • Against Traditional Codecs: RAWIC achieves an average 7.7% bitrate reduction relative to JPEG-XL on raw image datasets (Canon 1Ds MkIII, Canon 600D, Olympus EPL6, Panasonic GX1, Samsung NX2000, RAISE), with one unified model. Notably, compression ratios improve dramatically as image bit depth deviates from conventional 8-bit scenarios, effectively exploiting bit-depth-specific redundancy.
  • Against Learned Codecs (RGB, 8-bit): Retrained RAWIC is competitive with state-of-the-art learned lossless codecs on sRGB images, with slight improvements in bpp across DIV2K, CLIC, and Kodak benchmarks.

Ablation Analysis

  1. Bit-Depth Adaptive vs. Fixed Entropy: Disabling bit-depth adaptivity (fixed model) results in severe compression degradation (up to 75.7% higher bpp on Olympus EPL6).
  2. All-in-One vs. Sensor-Specific: The unified (all-in-one) model generally outperforms or matches sensor-specific models; generalization does not degrade coding efficiency, confirming the effectiveness of RAWIC's bit-depth conditioning mechanism.

Efficiency Considerations

  • RAWIC's runtime is higher than classical codecs, reflecting the computational overhead of deep neural entropy models. Encoding and decoding large raw images (e.g., Canon 600D, 3464ร—5202, 14-bit) require tens to hundreds of seconds per image on contemporary hardware, indicating that optimized inference will be necessary for latency-critical applications.
  • The computational profile for sRGB images is similar to other learned codecs and acceptable for offline or batch compression contexts.

Practical and Theoretical Implications

RAWIC represents the first codec enabling universal, distortion-free, bit-depth-adaptive learned lossless compression for raw sensor data. From a practical perspective, this enables efficient archival, cloud transmission, and remote sensing of native camera outputs for computational photography and professional workflows. The approach is not bounded to a class of sensors or bit depths, requiring no model retuning or camera-specific calibration.

Theoretically, RAWIC advances entropy modeling by parameterizing latent distributions with non-static, data-adaptive side information (bit depth), effectively decoupling the learned model from rigid assumptions about image structure. This encourages future research into more general adaptive and multimodal entropy models in the learned compression literature.

There remains a challenge with computational throughput. The model's encoding and decoding runtime suggests a need for architectural or algorithmic optimization. Techniques such as lightweight entropy models, neural inference hardware acceleration, or hybrid codec designs may close the gap for real-time and embedded applications.

Conclusion

RAWIC delivers a single, unified, bit-depth-adaptive framework for lossless raw image compression, surpassing traditional and recent learned codecs in coding efficiency across heterogeneous camera sensors and bit depths. Its bit-depth-conditioned neural entropy modeling yields both superior bitrate savings and robust generality. Future developments should focus on minimizing latency and resource usage to facilitate real-time deployment in camera pipelines and edge devices.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We found no open problems mentioned in this paper.

Collections

Sign up for free to add this paper to one or more collections.