Raw-JPEG Adapter: Efficient Raw Image Compression with JPEG
Mahmoud Afifi, Ran Zhang, Michael S. Brown
TL;DR
The paper addresses the challenge of storing raw sensor data efficiently by introducing Raw-JPEG Adapter, a lightweight, invertible pre-processing pipeline that renders raw data compatible with standard JPEG while preserving reconstruction fidelity. It uses a compact network to predict parameters for three invertible operations—a channel-wise gamma map $\boldsymbol{\Gamma}$, 1D RGB LUTs, and an optional global 8×8 DCT scaling $\mathbf{S}$—with these parameters stored in the JPEG COM segment so decoding can exactly recover the original raw via reverse operations: $\hat{\mathbf{I}} = F^{-1}(\mathrm{Dec}(\mathrm{Enc}(F(\mathbf{I};\theta)));\theta)$. Trained in a self-supervised fashion through a differentiable JPEG simulator, the method achieves higher fidelity than direct JPEG storage and several raw-reconstruction baselines across multiple datasets (S24, S7, MIT-Adobe FiveK, NUS) and remains compatible with other codecs (e.g., JPEG 2000, LIC-TCM). The approach delivers substantial storage savings while preserving post-capture editability, enabling high-quality rendering with substantially smaller files (often under a few megabytes) and minimal decoding overhead. The work also introduces metrics like wBPP to account for tonal diversity, and demonstrates strong cross-camera generalization, broad applicability, and potential for post-capture re-rendering without large metadata overhead.
Abstract
Digital cameras digitize scene light into linear raw representations, which the image signal processor (ISP) converts into display-ready outputs. While raw data preserves full sensor information--valuable for editing and vision tasks--formats such as Digital Negative (DNG) require large storage, making them impractical in constrained scenarios. In contrast, JPEG is a widely supported format, offering high compression efficiency and broad compatibility, but it is not well-suited for raw storage. This paper presents RawJPEG Adapter, a lightweight, learnable, and invertible preprocessing pipeline that adapts raw images for standard JPEG compression. Our method applies spatial and optional frequency-domain transforms, with compact parameters stored in the JPEG comment field, enabling accurate raw reconstruction. Experiments across multiple datasets show that our method achieves higher fidelity than direct JPEG storage, supports other codecs, and provides a favorable trade-off between compression ratio and reconstruction accuracy.
