RapidRAW Logo RapidRAW
Verified in v1.6.7
Documentation Menu

Rendering Pipeline

Three stages of the same Sony A7 III RAW of a foggy autumn cliff: the raw sensor mosaic up close, the decoded image with only an exposure change, and the finished edit with warm autumn colors

This section explains how RapidRAW works inside. It is written for people who want to know exactly what a slider does, compare RapidRAW with other raw developers, or contribute to the code. You don't need any of it to edit photos.

Overview

Every time the image is shown or exported, RapidRAW renders it from the original file plus your settings. Nothing is baked in. The work is split into a CPU part, which runs once per photo or when geometry changes, and a GPU part, which runs on every slider move.

The CPU part is Rust, multi-threaded with Rayon; AI models run through ONNX Runtime. The GPU part uses wgpu with WGSL shaders. Panorama, HDR and focus stacking merges also run on the CPU.

RAW files CPU
Decode→Black and white levels→Demosaic→Highlight reconstruction→Camera color→Base color NR→Pre-sharpening
JPEG, PNG, TIFF, ... CPU
Decoded and kept sRGB-encoded. The GPU converts them to linear light.
Base image CPU, AI, cached
AI Denoise→Negative Conversion→Retouch patches
Geometry CPU
Lens correctionGuided perspectiveTransform
Depth effects CPU, AI maps
Relight→Fog→Lens Blur
Crop and upload CPU
Crop, rotation and flips, then uploaded to the GPU as a 16-bit float texture. Masks are rasterized on the CPU and uploaded with it.
Adjustments GPU
One compute shader (shader.wgsl) applies every slider in a fixed order, including noise reduction, sharpening, glow, halation, flares, tone mapping, LUTs and grain. Helper shaders build the guided filters and blurs. This is the only part that runs on every slider move.
Output
Drawn to the screen by display.wgsl, or resized and encoded on the CPU as the export file.

The order in which you move sliders never matters. The shader always applies them in the same sequence, described in Tone & Color and Detail & Effects.

Working color spaces

RapidRAW does not use ACEScg or Rec.2020 as a general working space. Linear Rec.709 is used up to the tone mapper; AgX internally renders in a wider space.

Show the color space of every stage
Stage Space
RAW after decoding Scene-linear RGB with Rec.709/sRGB primaries and a D65 white. Values above 1.0 are kept (up to 1000), so highlight data is not clipped. White balanced to "as shot".
Non-RAW files Stay sRGB-encoded on the CPU. The shader converts them to linear with the exact sRGB curve.
GPU input texture RGBA 16-bit float (half precision).
Noise reduction Square-root ("variance stabilized") luminance, so noise is roughly equal in shadows and highlights.
Clarity, Structure, tonal base log2 luminance (stops), through guided filters.
Exposure, white balance, color grading, vignette Scene-linear. White balance is a Bradford adaptation in LMS space.
Whites, Shadows, Blacks, Contrast Luminance in a gamma 2.2 encoding, applied back as linear ratios.
HSL mixer, Hue HSV of sRGB-encoded values; luminance measured in linear Rec.709.
Tone mapper Linear to display. AgX uses a Rec.2020-based rendering space.
Film emulations Panasonic V-Log encoding of the linear image, then a 3D LUT.
Brightness, Curves, custom LUTs, Grain Display-referred, 0 to 1.
Output 8-bit (with dither) or 16-bit float for 16-bit TIFF exports. Exports get an sRGB profile.

What gets recomputed

Each stage keeps its result and only runs again when one of its own settings, or a stage before it, changes. That's why most sliders react instantly, while turning on AI Denoise or changing the lens correction takes a moment.

DecodeBase imageGeometryDepth effectsCrop and uploadGPU shader
Open a photoor change the RAW processing settings
AI Denoise, Negative Conversionor a retouch patch (AI Remove, inpainting)
Lens correction, Transformor guided perspective
Relight, Fog, Lens Blur
Crop, rotate, flip
Any other sliderExposure, color, detail, effects, curves, mask adjustments
runs againreused from the cache

Depth effects are skipped entirely when Relight, Fog and Lens Blur are off. Their depth and normal maps are made by an AI model once per photo and kept on disk. Drawing or changing a mask rasterizes it again on the CPU before the GPU step.

When only the GPU shader runs:

  • The image is already on the GPU, with helper textures computed once per image: guided-filter coefficients for Clarity, Structure and the tonal base, and a haze map for Dehaze. They're calculated on a grid with a short side of at most 1080 px, so local-contrast tools look the same in a small preview and a full-size export.
  • RapidRAW compiles a version of the shader that only contains the features you use. Until it's ready, a generic version with everything is used (same result, a bit slower).
  • Up to four blurred copies are kept for sharpening, halation and glow. They're only made again when the image or its size changes.
  • The shader runs once per 2048 px tile (with 128 px overlap).

Preview vs. export

Editor preview Export
Resolution Matched to the size shown on screen and your zoom (Dynamic, the default). In Fixed Resolution mode, a set long edge such as 1920 px. Full resolution.
While dragging Can be downscaled 1.2x (Performance mode) for speed. When zoomed in, only the visible area is rendered. n/a
Output 8-bit, drawn directly to the window. 8-bit, or 16-bit float for 16-bit TIFF.

Effects with a radius (blurs, grain, noise reduction search) scale with the image size, so a setting looks the same in the preview and the export. A few small fixed-size windows (the 3x3 neighbourhood used to limit sharpening halos, the noise reduction patches) can look slightly stronger on a small preview.

Caches

RapidRAW keeps several caches so that it only recomputes what changed:

Cache Contents Size
Decoded images Fully developed linear images, after base NR and sharpening. Images that are not active are compacted to half precision. 5 images or 1/5 of RAM
Preview stages Base with AI denoise and patches, downscaled working copy, geometry-warped copy, effects (Relight, Fog, Lens Blur). Each stage is only recomputed when its inputs change. 1 per stage
GPU textures Uploaded image and its helper textures. 3 images
AI Denoise Denoised images on disk (.rrdn, half precision). 10 GB
AI maps Depth and normal maps on disk (PNG). 4 GB
Thumbnails JPEG thumbnails on disk. 10 GB
Masks Rasterized masks in memory. 128 MB

Limits can be changed in Settings → Data Management.

A file is identified by a hash of its size and its first and last 64 KB, so AI results survive renames and moves, and are recalculated when the file content changes.

Pages in this section

  • RAW Processing: decoding, demosaicing, highlight reconstruction, camera color, base noise reduction and sharpening.
  • Tone & Color: exposure, white balance, tonal sliders, HSL, color grading, tone mappers, film emulation and curves.
  • Detail & Effects: noise reduction, sharpening, clarity, structure, dehaze, glow, halation, flares and grain.
  • AI & Masks: the AI models, how masks are built and combined, AI Denoise and inpainting.
  • Depth Effects: Relight, Fog and Lens Blur.
  • Geometry, Merging & Export: lens correction, perspective, auto tools, panorama, HDR, focus stacking and file output.