Vapoursynth RemoveGrain: Difference between revisions
New filter page (via create-page on MediaWiki MCP Server) |
Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server) |
||
| Line 13: | Line 13: | ||
! Control !! Parameter !! Range !! Hybrid default !! Meaning | ! Control !! Parameter !! Range !! Hybrid default !! Meaning | ||
|- | |- | ||
| Mode || mode || 1 – 24 || | | Mode || mode || 1 – 24 || 2 || Filter mode, applied to all planes; see the mode list in the tooltip. | ||
|- | |- | ||
| Tools: RG || tools || zsmooth, neo_smo || zsmooth || Plugin that provides RemoveGrain. | | Tools: RG || tools || zsmooth, neo_smo || zsmooth || Plugin that provides RemoveGrain. | ||
| Line 21: | Line 21: | ||
== Example == | == Example == | ||
Default settings on a 10-bit YUV 4:2:0 source: | Default settings on a 10-bit YUV 4:2:0 source (640x356): | ||
< | <pre> | ||
# removing grain using RemoveGrain | # removing grain using RemoveGrain | ||
clip = core.zsmooth.RemoveGrain(clip, mode= | clip = core.zsmooth.RemoveGrain(clip, mode=2) | ||
</ | </pre> | ||
== How Hybrid calls it == | == How Hybrid calls it == | ||
Latest revision as of 09:52, 16 November 2026
RemoveGrain is a purely spatial 3×3 filter with 24 modes: clipping and median variants, line-sensitive clipping, blurs and simple field interpolators. On its own it is a light denoiser; it is mostly used as a building block in other filters.
Filtering → Vapoursynth → DeGrain

What it does
Each pixel is compared with its eight neighbors and replaced according to the mode, for example clipped to the range of its neighbors (modes 1–4), clipped in a line-preserving way (5–10), blurred (11, 12, 19, 20), or interpolated from the lines of the other field (13–16).
Settings
| Control | Parameter | Range | Hybrid default | Meaning |
|---|---|---|---|---|
| Mode | mode | 1 – 24 | 2 | Filter mode, applied to all planes; see the mode list in the tooltip. |
| Tools: RG | tools | zsmooth, neo_smo | zsmooth | Plugin that provides RemoveGrain. |
Modes 13–16 interpolate one field from the other and are meant for interlaced material; for normal denoising choose one of the clipping or median modes.
Example
Default settings on a 10-bit YUV 4:2:0 source (640x356):
# removing grain using RemoveGrain clip = core.zsmooth.RemoveGrain(clip, mode=2)
How Hybrid calls it
- RemoveGrain works on 8–16-bit integer YUV.
- The mode is always written and applies to all planes.
- The filter is not interlace-aware: interlaced clips are processed as separated fields.
- RemoveGrain also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).
Background
zsmooth (RemoveGrain)
zsmooth's RemoveGrain supports modes 0–24 (0 copies the plane), one mode per plane, 8–16-bit integer and 16/32-bit float clips, and mirrors the frame edges. neo_smo offers the same function with the same arguments.
vs-removegrain (rgvs)
The old VapourSynth RemoveGrain plugin documents the modes in detail; it marked modes 4, 11, 12, 19 and 20 as replaceable by std.Median and std.Convolution and copied the edge rows and columns instead of mirroring them.
Sources
- zsmooth README
- vs-removegrain documentation (mode descriptions)
- Hybrid's tooltips