Rendering Pipeline
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 CPU decodes the file, runs the AI tools, Negative Conversion and retouch patches, and rasterizes masks. Everything after that, including lens correction, perspective, Relight, Fog, Lens Blur, crop and every slider, runs on the GPU, so the image stays on the graphics card while you edit.
The CPU part is Rust, multi-threaded with Rayon; AI models run through ONNX Runtime. The GPU part uses wgpu with WGSL compute shaders. Panorama, HDR and focus stacking merges run on the CPU.
shader.wgsl) applies every slider in a fixed order, including noise reduction, sharpening, glow, halation, flares, tone mapping, LUTs and grain. Motion blur runs just before it. Helper shaders build the guided filters, blurs and the light pyramid for glow, halation and flares.
display.wgsl. With Enable Direct WGPU Render off (the default on Linux), the preview is sent as a JPEG, encoded in parallel strips. Exports are read back, resized and encoded on the CPU.
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 | Embedded ICC profiles (and Adobe RGB marked only in EXIF) are converted to sRGB on load. Out-of-gamut colors are desaturated toward their brightest channel instead of clipped. The image stays sRGB-encoded on the CPU and the shader converts it 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 for 16-bit TIFF exports. JPEG, PNG and TIFF exports embed 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. Geometry, depth effects and the frame run together as one GPU pass, so changing any of them repeats that pass, but nothing is copied between the CPU and the GPU. Apart from masks, only AI Denoise, Negative Conversion and retouch patches make the CPU redo image work.
A new working copy is also made when zooming or cropping needs a different preview size. Its size moves in half-octave steps, so small changes reuse it. 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; color, luminance and match brush masks also when the geometry changes, because they read a geometry-corrected copy of the image.
When you browse in the editor, the next two photos in the direction you're going and the previous one are decoded in the background once the current photo is on screen, if the cache has room. Moving to one of them skips the decode step.
When only the adjustments shader runs:
- The image is already on the GPU, with helper textures computed once per GPU pass: 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).
- Two blurred copies for sharpening are kept, and glow, halation and flares share a light pyramid that is only built again when the image, Exposure, Brightness, Whites or their thresholds change. Motion blur results are cached too.
- 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 (1.4x when zoomed in) in 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 for 16-bit TIFF. Images larger than the GPU's maximum texture size are scaled down to fit. |
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, including preloaded neighbours. Images that are not active are compacted to half precision. | 5 images or 1/5 of RAM |
| Preview stages (CPU) | Base image with AI Denoise, Negative Conversion and patches, and the downscaled working copy. | 1 per stage |
| Geometry copy for AI | Full-size, geometry-corrected 8-bit copy used by AI masks and color, luminance and match brush masks. | 1 image |
| GPU uploads | The uploaded working copy, so a geometry or crop change doesn't upload again. | 2 images |
| GPU results | Result of the GPU pass (geometry, depth effects, frame) with its helper textures. | 3 images, 50 MP in total |
| Lens profiles | The lens correction profile of each file. | 1024 files |
| 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.
The editor and the second viewer window each keep their own preview and GPU result caches.
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.
RapidRAW