Avisynth EdgeCleaner

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

EdgeCleaner is a simple edge cleaner and weak dehaloer. It cleans up ragged or slightly haloed lines without touching flat areas.

Filtering → Avisynth → DeHalo

EdgeCleaner controls in Hybrid
EdgeCleaner controls in Hybrid

What it does

The script warps the picture toward its edges with aWarpSharp2, which thins lines and pulls halos in. If Repair is on, the result is limited against the source so it cannot move too far. The effect is blended in only along edges, using an inverted Prewitt edge mask.

Two optional extras: Smoothing protects small stars or particles (they are restored from the source), and Remove hot pixels does an additional Repair pass against the source.

Picture sizes divisible by 16 or 32 work best.

Requirements

  • Windows, CPU only.
  • The helper plugins (aWarpSharp2, masktools2, RgTools) are shipped with Hybrid.

Settings

Control Parameter Range Hybrid default Meaning
Strength strength 0–100 10 Edge denoising strength. The warp depth is strength / 2 (rounded), plus 4 when Smoothing is on.
Repair rep on/off on Limits the result against the source with Repair.
Repair mode rmode 0–18 17 Repair mode, only available while Repair is on. 1 is mild and good for halos. 16 and 18 keep structure with strong settings but leave more halos; 17 is like 16 with less haloing. Other modes are not recommended.
Smoothing smode 0–2 0 0 off. 1 uses a RemoveGrain-based star mask, 2 a mini-Deen-based one. Stars are restored from the source.
Remove hot pixels hot on/off off Extra Repair mode 2 pass against the source.

Example

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

EdgeCleaner()

How Hybrid calls it

  • Hybrid loads masktools2, aWarpSharpMT, the RemoveGrain helper and EdgeCleaner.avs, then calls EdgeCleaner.
  • Planar Y8, YV12, YV16 and YV24 input; other formats are converted first. The example needs no conversion.
  • Parameters are only written when they differ from the defaults (Repair and Remove hot pixels as true/false). Repair mode is only written while Repair is on.
  • The filter is not interlace-aware.
  • EdgeCleaner also offers the common options and can be added to the filter queue several times.

Background

  • The script is EdgeCleaner v1.041 (2020-04-18). It needs aWarpSharp (SEt), masktools2, Repair and RemoveGrain, and optionally Deen.

See also: Vapoursynth EdgeCleaner

Sources

  • The AviSynth+ documentation does not cover EdgeCleaner.
  • Header of the script EdgeCleaner.avs
  • Hybrid's tooltips