Vapoursynth CTMF

From wiki.selur.net
Revision as of 21:09, 14 November 2026 by Selur (talk | contribs) (New filter page (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

CTMF is a spatial median filter: every pixel is replaced by the median of a square around it. It removes specks and impulse noise and smooths flat areas, but also takes away fine detail.

Filtering → Vapoursynth → DeNoise

CTMF controls in Hybrid
CTMF controls in Hybrid

What it does

The values of the (2·radius+1)×(2·radius+1) square around a pixel are sorted and the middle one is taken. Single outliers disappear completely, edges stay sharper than with a blur.

Settings

Control Parameter Range / values Hybrid default Meaning
Radius radius 1 – 3 2 Kernel size: 1 = 3×3, 2 = 5×5, 3 = 7×7.
Planes planes all, chroma only, luma only all Planes that are filtered.

Example

Default settings on a 10-bit YUV 4:2:0 source:

# denoising using CTMF
clip = misc.median_blur(clip, tools={'median': 'zsmooth'})

How Hybrid calls it

  • The median comes from zsmooth; the original CTMF plugin is no longer maintained and is not shipped.
  • The filter accepts 8–16-bit integer and 32-bit float YUV and RGB clips.
  • Radius and planes are only written when they differ from the defaults.
  • CTMF also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

VapourSynth-CTMF

CTMF stands for constant time median filter: its run time does not grow with the radius, which allowed radii up to 127. The project is archived and points to a median blur as replacement. zsmooth's median supports radii up to 3 (7×7), 8–16-bit integer and 16/32-bit float clips in RGB, YUV and Gray, and mirrors the frame edges.

Sources