Avisynth RemoveDirt
RemoveDirt is a temporal cleaner for film dirt: specks and blotches that are visible in one frame only. It combines a temporal clense with a motion detection.
Filtering → Avisynth → Artifacts

What it does
A temporal clense (median of previous, current and next frame) cleans the frame. A motion detection on 8×8 blocks decides where the cleaned result is safe, that is in static areas. In moving areas a repaired version is used instead. A final RemoveGrain pass smooths the result.
Typical uses:
- Remove dust and dirt from film in one pass without much tuning.
- It can soften detail and fast motion.
Requirements
The plugin neo-smo is needed; Hybrid ships it. The image size must be a multiple of 8.
Settings
| Control | Parameter | Range | Hybrid default | Meaning |
|---|---|---|---|---|
| Mode | repmode | 0–24 | 16 | Repair mode that is applied to the cleaned frame in comparison with the original. It is the same number as a RemoveGrain or Repair mode. It applies to luma and chroma alike. |
| Grey | _grey | on/off | off | Processes luma only and passes chroma through untouched. Faster. |
Some values are fixed: final RemoveGrain mode 17, motion noise 10, noisy pixels 12, scene-change threshold 70, distance 1 and distance mode 2.
Example
Default settings on a 10-bit YUV 4:2:0 source. Hybrid adds no conversion lines to the script:
# temporal cleaning using RemoveDirt RemoveDirt()
How Hybrid calls it
- Hybrid loads RemoveDirt.dll, the neo-smo plugin and a RemoveDirt.avs wrapper script, then calls
RemoveDirt(). The neo-smo plugin provides the clense, repair and RemoveGrain functions. - The filter accepts Y8, YV12, YV16 and YV24 (8-bit). Other formats are converted before the filter and back afterwards.
- Parameters are only written when they differ from the default.
- Chroma uses the same mode as luma (U and V both use Mode, final mode 17). With Grey chroma is skipped.
- The filter works on the CPU.
- RemoveDirt also offers the common options and can be added to the filter queue several times.
Background
RemoveDirt was written by Rainer Wittmann (kassandro). The shipped RemoveDirt.dll is the port by pinterf with 8–16 bit support; thresholds do not depend on the bit depth and YUY2 is dropped. Hybrid's wrapper follows the classic RemoveDirt script: clense, a repaired alternative, RestoreMotionBlocks and a final RemoveGrain.
Plugin parameters in short: noise is the difference up to which the motion detection ignores changes. noisy is the number of noisy pixels per block needed to call it motion. gmthreshold is the percentage of motion blocks above which the frame counts as a scene change. Hybrid does not offer the noise limit or the final RemoveGrain mode.
See also: Vapoursynth RemoveDirt
Sources
- RemoveDirt (port, README)
- Hybrid's tooltips
- The AviSynth+ documentation does not cover RemoveDirt.