Add HDF (Highlight Diffusion Filter) to the FX tab

The built-in lens filter, simulated the way it is done in Photoshop: pull the
highlights out with a hard contrast curve (out = 2.5*in - 1.5, black below 0.6),
Gaussian-blur that selection, then Screen it back over the photo at reduced
opacity. Screen against a near-black pixel is a no-op, so areas with no
highlight within the blur radius come back byte-identical while lit areas
spread their light.

One 0..10 knob drives both the radius (4%..1.9% of the width, ~10..50px at
2560 wide) and the opacity (0.15..0.5), matching the recipe's 15-50px radius
range. The extraction composes on top of the recipe colour matrix so a
monochrome look glows white instead of leaking the original colours back.

Runs in the Skia export engine only; the P5 native path is not wired into the
app (dev parity probe only), so it is left alone for now.
This commit is contained in:
2026-09-10 09:45:51 +07:00
parent 3a8b110c1b
commit 28e18893cd
3 changed files with 61 additions and 0 deletions
+11
View File
@@ -161,5 +161,16 @@ export const PARAM_DEFS: {
get: (a) => a.grain,
set: (v) => ({ grain: v }),
},
{
key: 'hdf',
label: 'HDF',
min: 0,
max: 10,
step: 1,
defaultValue: 0,
display: String,
get: (a) => a.hdf ?? 0,
set: (v) => ({ hdf: v }),
},
],
};