median:MultipassFilter< { radius:{ default:1; description:"Size of the neighbourhood in pixels."; label:"Radius (px)"; max:3; min:1; type:"int"; unit:"px"; }; }, > = ...
Per-channel median over a (2r + 1)² window (clamp to edge), alpha included: removes isolated
specks and keeps edges. The result is always one of the window's values, so GPU and CPU agree
exactly. On the GPU the median is found by counting (for each candidate, how many values are
smaller or equal), vectorised over the four channels: no sort, no data-dependent branches.
Per-channel median over a (2r + 1)² window (clamp to edge), alpha included: removes isolated specks and keeps edges. The result is always one of the window's values, so GPU and CPU agree exactly. On the GPU the median is found by counting (for each candidate, how many values are smaller or equal), vectorised over the four channels: no sort, no data-dependent branches.