Table of Contents
Fetching ...

Edit-aware RAW Reconstruction

Abhijith Punnappurath, Luxi Zhao, Ke Zhao, Hue Nguyen, Radek Grzeszczuk, Michael S. Brown

TL;DR

This work tackles the mismatch between RAW reconstruction and real-world photo editing by introducing an edit-aware loss implemented via a differentiable, modular ISP. By sampling exposure, white balance, color, and tone adjustments during training and rendering both ground-truth and recovered RAWs to sRGB, the method optimizes RAW reconstructions for diverse edits. It demonstrates consistent sRGB improvements (up to 1.5–2 dB PSNR) across metadata-assisted and blind models and enables target-edit-aware fine-tuning, enhancing practical edit fidelity. The approach offers a flexible, plug-and-play enhancement to existing RAW reconstruction pipelines with minimal inference impact, aligning reconstruction objectives with consumer photo-editing workflows.

Abstract

Users frequently edit camera images post-capture to achieve their preferred photofinishing style. While editing in the RAW domain provides greater accuracy and flexibility, most edits are performed on the camera's display-referred output (e.g., 8-bit sRGB JPEG) since RAW images are rarely stored. Existing RAW reconstruction methods can recover RAW data from sRGB images, but these approaches are typically optimized for pixel-wise RAW reconstruction fidelity and tend to degrade under diverse rendering styles and editing operations. We introduce a plug-and-play, edit-aware loss function that can be integrated into any existing RAW reconstruction framework to make the recovered RAWs more robust to different rendering styles and edits. Our loss formulation incorporates a modular, differentiable image signal processor (ISP) that simulates realistic photofinishing pipelines with tunable parameters. During training, parameters for each ISP module are randomly sampled from carefully designed distributions that model practical variations in real camera processing. The loss is then computed in sRGB space between ground-truth and reconstructed RAWs rendered through this differentiable ISP. Incorporating our loss improves sRGB reconstruction quality by up to 1.5-2 dB PSNR across various editing conditions. Moreover, when applied to metadata-assisted RAW reconstruction methods, our approach enables fine-tuning for target edits, yielding further gains. Since photographic editing is the primary motivation for RAW reconstruction in consumer imaging, our simple yet effective loss function provides a general mechanism for enhancing edit fidelity and rendering flexibility across existing methods.

Edit-aware RAW Reconstruction

TL;DR

This work tackles the mismatch between RAW reconstruction and real-world photo editing by introducing an edit-aware loss implemented via a differentiable, modular ISP. By sampling exposure, white balance, color, and tone adjustments during training and rendering both ground-truth and recovered RAWs to sRGB, the method optimizes RAW reconstructions for diverse edits. It demonstrates consistent sRGB improvements (up to 1.5–2 dB PSNR) across metadata-assisted and blind models and enables target-edit-aware fine-tuning, enhancing practical edit fidelity. The approach offers a flexible, plug-and-play enhancement to existing RAW reconstruction pipelines with minimal inference impact, aligning reconstruction objectives with consumer photo-editing workflows.

Abstract

Users frequently edit camera images post-capture to achieve their preferred photofinishing style. While editing in the RAW domain provides greater accuracy and flexibility, most edits are performed on the camera's display-referred output (e.g., 8-bit sRGB JPEG) since RAW images are rarely stored. Existing RAW reconstruction methods can recover RAW data from sRGB images, but these approaches are typically optimized for pixel-wise RAW reconstruction fidelity and tend to degrade under diverse rendering styles and editing operations. We introduce a plug-and-play, edit-aware loss function that can be integrated into any existing RAW reconstruction framework to make the recovered RAWs more robust to different rendering styles and edits. Our loss formulation incorporates a modular, differentiable image signal processor (ISP) that simulates realistic photofinishing pipelines with tunable parameters. During training, parameters for each ISP module are randomly sampled from carefully designed distributions that model practical variations in real camera processing. The loss is then computed in sRGB space between ground-truth and reconstructed RAWs rendered through this differentiable ISP. Incorporating our loss improves sRGB reconstruction quality by up to 1.5-2 dB PSNR across various editing conditions. Moreover, when applied to metadata-assisted RAW reconstruction methods, our approach enables fine-tuning for target edits, yielding further gains. Since photographic editing is the primary motivation for RAW reconstruction in consumer imaging, our simple yet effective loss function provides a general mechanism for enhancing edit fidelity and rendering flexibility across existing methods.

Paper Structure

This paper contains 16 sections, 14 equations, 11 figures, 8 tables.

Figures (11)

  • Figure 1: (A) Existing RAW reconstruction methods typically employ loss functions focused on accurate per-pixel RAW recovery (green path). However, the primary use of a reconstructed RAW image is to allow high-quality editing targeting sRGB outputs. This paper introduces an edit-aware loss for RAW reconstruction that yields higher sRGB fidelity across diverse edits (yellow path). (B) Two example edits applied to the RAW estimated by a conventional reconstruction method rawdiff (left), the RAW reconstructed by augmenting rawdiff with our edit-aware loss (middle), and the ground-truth RAW (right). Renderings are produced in Adobe Photoshop using the indicated settings. Our results more closely match the ground truth across edits.
  • Figure 2: Overview of our edit-aware loss framework and differentiable ISP design. (A) Conventional RAW reconstruction models optimize for per-pixel RAW fidelity (green path), which often yields suboptimal results under diverse rendering or editing operations. We introduce an edit-aware loss (yellow path) that complements existing objectives by promoting robustness across different rendering styles. Our loss pipeline mimics a modular tunable differentiable ISP whose module parameters---exposure, white balance, color, and tone---are randomly sampled from distributions modeling realistic ISP settings. Both the ground-truth and reconstructed RAWs are rendered to sRGB using the same sampled parameters, and the loss is computed in sRGB space to encourage edit-consistent reconstruction. (B) Each column shows three samples illustrating the diversity of exposure, white balance, color, and tone adjustments encountered during training.
  • Figure 3: Results of adding our edit-aware loss to the RAW reconstruction method in CAM cam. See Table \ref{['tab:edits']} for details of the edits. While the baseline model suffers from banding and color distortions, adding our edit-aware loss improves color and tone reproduction accuracy.
  • Figure 4: Results of adding our edit-aware loss to the RAW recovery method in RAW Diffusion rawdiff. See Table \ref{['tab:edits']} for details of the edits. Compared to the baseline, which shows pronounced global color distortions, our edit-aware method more closely matches the ground truth.
  • Figure 5: Results of fine-tuning (FT) a UNet-based unet metadata-assisted RAW reconstruction model using our edit-aware loss. Our loss enables fine-tuning not only on the specific test image but also with respect to the target edit, yielding reconstructions that better align with the desired photofinishing outcome.
  • ...and 6 more figures