Vapoursynth EdgeCleaner: Difference between revisions

From wiki.selur.net
Jump to navigation Jump to search
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 34: Line 34:
== Example ==
== Example ==
Default settings on a 10-bit YUV 4:2:0 source:
Default settings on a 10-bit YUV 4:2:0 source:
<syntaxhighlight lang="python">
<pre>
# Dehalo using EdgeCleaner
# Dehalo using EdgeCleaner
clip = dehalo.EdgeCleaner(clip, tools={'expr': 'akarin', 'warp': 'warp', 'rg': 'zsmooth', 'edgemasks': 'edgemasks'})
clip = dehalo.EdgeCleaner(clip, tools={'expr': 'akarin', 'warp': 'warp', 'rg': 'zsmooth', 'edgemasks': 'edgemasks'})
</syntaxhighlight>
</pre>


== How Hybrid calls it ==
== How Hybrid calls it ==

Latest revision as of 09:49, 16 November 2026

EdgeCleaner is a simple edge cleaner and weak dehaloer. It warps the luma along edges and blends the result in only there, so flat areas stay untouched.

Filtering → Vapoursynth → DeHalo

EdgeCleaner controls in Hybrid
EdgeCleaner controls in Hybrid

What it does

The luma is warp-sharpened with AWarpSharp2, optionally limited by Repair against the source, and merged back through an inverted Prewitt edge mask. Optional steps remove hot pixels and keep small bright particles such as stars from the source. Only luma is processed; chroma passes through unchanged.

Settings

Control Parameter Range / values Hybrid default Meaning
Strength strength 1 – 250 10 Edge denoising strength; the warp depth is half of it (plus 2 with SMode).
Repair rep on/off on Repairs the warped clip against the source, which limits how far pixels may move.
Repair mode rmode 1 – 18 17 Repair mode; only available with Repair on. 1 is very mild and good for halos; 16 and 18 keep the edge structure on strong settings but leave more halos and edge noise; 17 is like 16 with much less haloing. Other modes are not recommended.
SMode smode on/off off Detects small particles (stars) and keeps them from the source, using RemoveGrain-based smoothing before the edge mask; also raises the strength by 4.
Hot hot on/off off Extra Repair pass (mode 2) against the source to remove hot pixels.
Tools: Expr tools akarin, cranexpr, std akarin (std without AVX2) Expression evaluator.
Tools: Warp tools warp, awarp warp AWarpSharp2 plugin, or AWarp with an emulated edge mask (not bit-identical).
Tools: EdgeMasks tools edgemasks, std edgemasks Prewitt edge mask implementation.
Tools: RG tools zsmooth, neo_smo zsmooth RemoveGrain/Repair implementation; only used with Repair, Hot or SMode.

Example

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

# Dehalo using EdgeCleaner
clip = dehalo.EdgeCleaner(clip, tools={'expr': 'akarin', 'warp': 'warp', 'rg': 'zsmooth', 'edgemasks': 'edgemasks'})

How Hybrid calls it

  • EdgeCleaner works on 8–16-bit integer YUV and Gray clips (no 14 bit); other formats are converted first.
  • Strength and Repair mode are only written when they differ from the defaults (Repair mode only with Repair on); Repair off, SMode and Hot are written when set.
  • None of the settings are pixel values; the script scales its internal mask thresholds to the clip's bit depth.
  • The clip is padded by 6 pixels before warping and cropped afterwards, which avoids border artifacts.
  • EdgeCleaner also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

The script

The VapourSynth version is a port of the AviSynth EdgeCleaner script, version 1.04. It rejects RGB clips.

Sources