Detail & Effects
Noise reduction, sharpening, Clarity, Structure and Dehaze run in the GPU shader before Exposure; Glow, Halation and Light Flares right after it, and Grain at the very end (see the order of operations). Clarity, Structure and Dehaze use helper textures that are computed once per photo on a grid with a short side of at most 1080 px, so they look the same in the preview and in a full-size export.
Noise reduction
The Luminance and Color sliders in the Details panel. (AI Denoise is a separate tool, see AI & Masks.)
Variance stabilization. Photon noise grows with brightness, so a filter tuned for shadows would be too weak in highlights. RapidRAW works on the square root of luma, which makes the noise roughly the same everywhere:
p = √(Y + 0.002) − √0.002
Noise is also judged as it will look after Exposure, so an image you brighten by 3 stops gets stronger noise reduction automatically.
Luminance: patch-based (non-local means). For each pixel, RapidRAW compares the 3x3 patch around it with the patches of all neighbours in a 7x7 window. Neighbours whose patch looks similar (within about one noise level) get full weight, others are ignored. This averages noise away while keeping edges, because pixels across an edge have different-looking patches.
σ = 0.002 + 0.06 · amount^1.3
weight = exp( −max(patch_distance² / (2.7σ²) − 1, 0) − 0.03·r² )
On large images (short side over about 1620 px) a second pass on a half-resolution grid removes coarser, blotchier noise. The slider mostly controls σ; the blend is already at full strength at 20.
Color: guided by luma. Chroma noise is removed with a sparse 37-sample filter that spans up to about 16 px. Its weights depend on luma similarity, on how close each sample's color is to a 5x5 reference, and on distance. It then fits a local linear model of color against luma and predicts the pixel's color from its denoised luma. Real color edges follow luma edges, so they stay sharp; color blotches don't, so they are averaged away.
Sharpening
Sharpening is a two-scale unsharp mask on luminance (square-root luma for RAWs):
detail = core(Y − blur_1px) + 0.5 · core(blur_1px − blur_3.5px)
core(d) = d³ / (d² + t²), t = 0.07 · threshold
- Threshold (coring): detail smaller than
t(noise) is suppressed; larger detail passes almost unchanged. The default threshold of 15 suits most cameras. - Halo limiting: the result is softly limited to the minimum and maximum of the 3x3 neighbourhood, plus a small allowance (15% of the local range for bright overshoot, 5% for dark). Dark halos are reduced by another 30%, because they are the most visible.
- Tone protection: no sharpening in deep shadows (where it would only sharpen noise) and near white.
- Applied as a luminance ratio, so edges don't get colored fringes.
- Negative values blend toward a light blur instead.
The sharpening threshold is global; masks can change the amount only.
Clarity and Structure
Both are local contrast tools based on a guided filter (He et al.) in log2 luminance, measured in stops:
I = log2(Y)
base = a·I + b edge-preserving smooth version of I
detail = I − base
rgb *= 2^(gain · amount · shape(detail))
| Radius (at 1080 px) | ε (stops²) | |
|---|---|---|
| Clarity | 8 px | 0.25 |
| Structure | 40 px | 0.5 |
- The guided filter keeps edges whose contrast is much larger than ε intact in the base, so strong edges get no detail boost and no halos.
shape(d) = d / (1 + (d/σ)²)limits the boost: small detail is amplified linearly, very large detail not at all. Bright detail is limited sooner (σ 0.8) than dark detail (σ 1.5).- Positive values are multiplied by 1.8, negative by 1.0. Negative values smooth instead.
- Positive values are faded out in near-black areas so noise isn't amplified.
Clarity works at a fine scale (textures, skin, small detail). Structure works at a larger scale (shapes, clouds, terrain).
Centré uses the same clarity term, positive in an ellipse around the chosen center and negative toward the edges, plus a bit of exposure, saturation and vibrance in the center.
Dehaze
Dehaze uses the dark channel prior (He, Sun, Tang): in haze-free outdoor images, most areas have at least one very dark color channel. Haze lifts that dark channel, so it can be used to measure how much haze there is.
- Airlight: the brightest 0.3% of the dark channel in a small version of the image. RapidRAW stores it as neutral grey, which avoids color casts.
- Haze map: the dark channel divided by the airlight, cleaned up with a morphological opening (radius 12 px at 1080) and refined with a guided filter (radius 48), guided by the image's brightness. This gives a smooth haze map that still follows edges.
- Recovery with the scattering model, on the base layer only (formula below).
- Safety limits: a floor on
tstops colors from clipping to black, sky and airlight-colored areas are protected, and saturation can rise by at most 1.45x, to avoid neon colors. - Detail and brightness: local detail gets the same contrast boost as the base. Darkened midtones are lifted back up a little.
The recovery step, with A the airlight and I the hazy image:
strength = 1 − (1 − amount)²
t = max(1 − strength · 0.95 · haze, 0.1) transmission
J = A + (I − A) / t only below the airlight
Negative Dehaze blends in a "mist" tinted with the average color of the scene, thicker where the haze map is already high.
Glow, Halation and Light Flares
All three share one light engine. It builds a small set of light maps from the photo once, caches them on the GPU, and the main shader adds them to the image in linear light right after Exposure, before white balance and tone mapping. So they behave like real light.
Light maps
Prefilter. The photo is area-averaged to a working copy with a short side of 720 px, whatever the photo size. This is why the effects look the same in the preview and in a full-size export.
Thresholds follow your edit. For each pixel, RapidRAW applies your Exposure gain, then Brightness and Whites to its luminance L, and converts the result to a perceptual (gamma 2.2) value p. Each effect keeps the light above its own cutoff, with a soft knee:
glow weight = smoothstep(c_g, c_g + 0.3, p) c_g = mix(0.75, 0.08, glow)
halation weight = smoothstep(c_h, c_h + k_h, p) c_h = mix(0.85, 0.10, halation), k_h = 0.6 · max(1.5 − c_h, 0.1)
flare weight = smoothstep(c_f, c_f + 0.1, p) c_f = mix(0.94, 0.72, flares)
More amount means a lower cutoff, so darker tones start to contribute. Glow keeps the color (rgb · weight), halation keeps only luminance (L · weight). For flares, clipped pixels (any channel above about 0.92 in the source) count up to 5x, because a clipped light is brighter than its pixel values say.
Pyramid. The prefiltered map is repeatedly halved with a 13-tap downsample, giving 7 levels (720 px down to 12 px on the short side). It is then rebuilt upward with a 3x3 tent upsample, adding each level with its own weight. Small weights on fine levels and large ones on coarse levels give a bright core with a long, soft tail, closer to real light scattering than one big blur.
| Level (short side) | 720 | 360 | 180 | 90 | 45 | 23 | 12 |
|---|---|---|---|---|---|---|---|
| Glow weight | 0 | 0.08 | 0.20 | 0.30 | 0.25 | 0.12 | 0.05 |
| Halation weight | 0.20 | 0.45 | 0.25 | 0.10 | 0 | 0 | 0 |
| Flare glare weight | 0 | 0.10 | 0.14 | 0.14 | 0.16 | 0.20 | 0.26 |
The maps only depend on the photo, Exposure, Brightness, Whites and the three amounts. When the effect is used in a mask, the cutoff comes from the global amount, or from the strongest mask amount if the global amount is 0. Any other slider reuses the cached maps.
Glow
The bloom map (sampled with a smooth B-spline filter) is added as warm light:
strength = amount · (0.35 + 0.85 · amount) · (0.5 + 0.5 · smoothstep(0, 0.2, Y))
rgb += bloom · (1.03, 1.0, 0.97) · strength · protect(rgb)
protect = 1 − smoothstep(1.0, 2.2, Y)
- The strength grows faster than the slider, so the first half of the slider stays subtle.
- Dark pixels get less glow (half at black, full from 0.2 luminance up), so the shadows aren't lifted into grey.
protectfades the glow out on pixels that are already far above white, so bright areas don't clip harder.
Halation
Halation imitates the red glow around bright lights on color film (light bouncing back off the film base). It uses the tight halation pyramid, so it hugs the light source. With e the halation energy:
tint = mix(orange (1.0, 0.32, 0.10), deep red (1.0, 0.15, 0.03), smoothstep(0, 0.7, e))
rgb = desaturate(rgb, 12% · e), then contrast toward 0.5 lowered by 6% · e
rgb += tint · e · amount · 2.5
So the core of the halo is deep red, the fringe orange, and the affected area loses a little saturation and contrast, as on film.
Light Flares
Flares are built from the flare map in four steps:
- Point sources. Each pixel's brightness is compared with a heavily blurred surround (pyramid level 4). A pixel much brighter than its surround (ratio 1.2 to 4) is a compact light and gets full weight; a broad bright area like the sky keeps only 5%. Very bright values are softly compressed (
f / (1 + 0.05 · L)) so one light can't swamp the rest. - Glare. The point map goes through its own pyramid with the glare weights above, giving a wide veil of scattered light around each source.
- Aperture. Levels 1 to 4 of the point pyramid are convolved with a 7-blade aperture (radius 5 px at each level, slightly rotated, with weight 0.65 in the middle rising to 1.0 at the rim). This gives the ghosts the polygon shape of a real iris at four sizes.
- Ghosts and halo. Eight ghosts are reflections of the light through the image center, at scales −0.16, −0.34, −0.58, −0.9, −1.3 and −2.0 (on the opposite side) and +0.24 and +0.5 (on the same side). Each ghost reads the aperture level that matches its size, has its own pastel tint, and splits red, green and blue by 3% for color fringes. Ghosts get weaker for lights far from the center and vanish for lights at the frame edge. A faint halo ring at 0.4 of the frame height around the center, with a 2.5% color spread, completes the flare.
flare = 0.40 · glare + 0.35 · ghosts + 0.22 · halo · (0.85, 0.92, 1.0)
rgb += flare · amount · protect(rgb)
There are no starburst rays or anamorphic streaks: the look comes from the glare, the aperture ghosts and the halo. The flare maps are only built when Light Flares is above 0.
Film Grain
Grain is the last step in the shader, after the custom LUT, on the display-referred image. It is built from individual grains rather than filtered noise.
Slider mapping, with scale = short side / 1080:
a = Amount / 250 0 to 0.4
cell = 0.243 · 2^(Size / 60) · scale grain cell in pixels
r = Roughness / 100
So Size 25 gives cells of about 0.32 px on a 1080 px preview and about 1.2 px on a 24 MP photo (short side 4000 px). Each +60 on Size doubles the grain.
Grain layer. The image plane is split into square cells. Every cell holds one grain with a random position inside the cell, a random radius (0.75 to 1.0 cells) and a random strength between −1 and +1. Each pixel adds up the grains of the 3x3 cells around it, with a soft round profile:
grain(p) = Σ strength · max(1 − d² / radius², 0)² over the 9 nearest cells
Neighbouring grains overlap, which gives the crisp, clumpy texture of film instead of the smooth look of blurred noise. When a cell is smaller than a pixel, the layer's strength is scaled by the cell size, the same as averaging the sub-pixel grains. That keeps the preview and the export alike.
Roughness adds a second grain layer 2.3x larger (weight 0.7 · r) and modulates both with smooth clumps 4x larger (1 + 0.9 · r · clumps). The result is divided by its expected spread, so Roughness changes the texture, not the strength.
Any size. Grain is generated at the two power-of-two cell sizes around cell and blended, with a variance-preserving weight, so Size changes smoothly.
Tone-aware strength. The grain shifts luma in log-odds space:
L' = L / (L + (1 − L) · e^(−grain · a))
rgb += L' − L
This is strongest in the midtones, smaller toward black and white, and can never push a value past 0 or 1. The same amount is added to R, G and B, so the grain is monochrome.
Grain-dependent softening. Real film can't hold detail finer than its grain. Early in the pipeline (right after sharpening, before Clarity), RapidRAW blends the image toward the 1 px blur also used by sharpening:
softness = min(3.75 · a, 1) · min(0.243 · 2^(Size/60), 1) · 0.75
At Amount 20 and Size 25 that is about 7%. The maximum is about 58% (Amount 67 or more, Size 100).
Chromatic Aberration
The manual sliders scale the red or blue channel by up to ±1% around the image center. Lens profile corrections are a separate, more accurate step that runs with the other geometry corrections on the GPU (see Geometry, Merging & Export).
RapidRAW