Skip to content

MosquitoNR

dnjulek edited this page Jun 23, 2026 · 1 revision

A port of MosquitoNR, a mosquito-noise reduction filter.

Usage

vszip.MosquitoNR(vnode clip[, int[] strength=16, int[] restore=128, int[] radius=2, int[] planes=[0]])

Parameters:

  • clip:
    Constant-format 8..16 bit integer or 32-bit float, YUV or Gray. Every processed plane must be at least 4x4 (note that chroma planes are smaller on subsampled formats). Float values are clamped to their valid range: luma [0, 1], chroma [-0.5, 0.5].
  • strength: (Default: 16)
    Blur strength, 0..32. 0 is an exact passthrough. Per-plane: pass an array to set a value for each plane; a single value applies to all.
  • restore: (Default: 128)
    How much of the original low-frequency band to restore, 0..128. 128 replaces it entirely (and is slightly faster); 0 skips restoration. Per-plane like strength.
  • radius: (Default: 2)
    Blur radius, 1..2. 1 is faster, 2 is stronger. Per-plane like strength.
  • planes: (Default: [0])
    Which planes to process; planes not listed are copied straight from the source. The default processes luma only (chroma copied), matching the classic MosquitoNR behavior. The filter is designed for luma, but processing chroma is allowed.

How it works

  1. Direction-aware blur (smoothing): for each pixel, pick the lowest-gradient of 8 directions and blend along it. Reduces compression artifacts but also softens detail.
  2. CDF 5/3 wavelet split of both the original and the smoothed image.
  3. Restore: blend the low-frequency (LL) band back from the original by restore, keeping the smoothed high-frequency detail.
  4. Inverse wavelet, then round/clamp back to the output depth.

Clone this wiki locally