Vapoursynth BlindDeHalo3: 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>
clip = dehalo.BlindDeHalo3(clip, interlaced=False, tools={'median': 'zsmooth'})
clip = dehalo.BlindDeHalo3(clip, interlaced=False, tools={'median': 'zsmooth'})
</syntaxhighlight>
</pre>


== How Hybrid calls it ==
== How Hybrid calls it ==
Line 42: Line 42:
* Values are only written when they differ from the defaults. PPLimit is written whenever PPMode is not 0, so the value shown in the GUI is the one used.
* Values are only written when they differ from the defaults. PPLimit is written whenever PPMode is not 0, so the value shown in the GUI is the one used.
* When PPMode is switched to ±3 while PPLimit is 0, Hybrid sets PPLimit to 4, the script's value for those modes.
* When PPMode is switched to ±3 while PPLimit is 0, Hybrid sets PPLimit to 4, the script's value for those modes.
* The interlace setting is always written: on when the current stream is not progressive.
* The interlace setting is always written: on when the current stream is not progressive. With it Hybrid also passes the field order of the source (detected or overwritten scan type) for the field separation: bottom field first only for a BFF stream, otherwise top field first.
* Detail and PPLimit are entered on the 8-bit scale; the script scales them to the clip's bit depth.
* Detail and PPLimit are entered on the 8-bit scale; the script scales them to the clip's bit depth.
* The smoothed resize on the Resize tab also uses BlindDeHalo3 internally, with default settings and its own strength.
* The smoothed resize on the Resize tab also uses BlindDeHalo3 internally, with default settings and its own strength.
Line 49: Line 49:
== Background ==
== Background ==
=== The script ===
=== The script ===
BlindDeHalo3 is a port of Didée's AviSynth script (version 3_MT2). Its interlace option is meant for material that was interlaced and later deinterlaced (for example through Restore24): the fields are separated as top field first, processed and woven back together. Apart from the optional zsmooth median it needs only core functions.
BlindDeHalo3 is a port of Didée's AviSynth script (version 3_MT2). Its interlace option is meant for material that was interlaced and later deinterlaced (for example through Restore24): the fields are separated in the given field order (top field first by default), processed and woven back together. Apart from the optional zsmooth median it needs only core functions.


== Sources ==
== Sources ==

Latest revision as of 09:47, 16 November 2026

BlindDeHalo3 removes the bright and dark halos that strong edge enhancement leaves around edges. An optional post-clean also removes leftover corona lines and mosquito noise.

Filtering → Vapoursynth → DeHalo

BlindDeHalo3 controls in Hybrid
BlindDeHalo3 controls in Hybrid

What it does

The luma is downscaled by the radii and blurred, the blurred copy is compared with the source, and the halo areas are pulled back towards it, guided by an edge mask. The post-clean (PPMode) then smooths the area around edges once more; negative modes skip the dehalo step and only run the post-clean. Only luma is processed; chroma passes through unchanged.

Settings

Control Parameter Range / values Hybrid default Meaning
Radius (x/y) rx / ry 0.01 – 10.00 3.0 / 3.0 Radii of the quasi-Gaussian blur the removal is based on; the clip is downscaled by these factors.
Strength strength 0 – 1000 125 Overall strength.
Detail (low) lodamp 0.00 – 20.00 0 Reduces the effect where the change would be small, which keeps detail. Useful for weak halos, not for heavy oversharpening; 4.0 is a starting point.
Detail (high) hidamp 0.00 – 20.00 0 Keeps small very bright or very dark areas from being processed too strongly.
Sharpness sharpness 0.00 – 1.58 0 Sharpens the result to restore edge definition; it also raises the strength (by a factor of 1 + sharpness × 0.25).
Tweaker tweaker 0.00 – 1.00 0 Stronger effect, independent of the strength.
PPMode PPmode −3 – 3 0 Post-clean: 0 = off, 1 = Gaussian blur, 2 = 3×3 average without the center, 3 = 3×3 median. Negative values do only the post-clean, for sources with more mosquito noise than halos.
PPLimit PPlimit 0 – 255 0 (4 for PPMode ±3) Largest change per pixel by the post-clean (8-bit scale); 0 = no limit. Only available while PPMode is not 0.
Tools: Median tools zsmooth, std zsmooth Median implementation; only used with PPMode ±3.

Example

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

clip = dehalo.BlindDeHalo3(clip, interlaced=False, tools={'median': 'zsmooth'})

How Hybrid calls it

  • BlindDeHalo3 works on 8–16-bit integer YUV clips; other formats are converted first.
  • Values are only written when they differ from the defaults. PPLimit is written whenever PPMode is not 0, so the value shown in the GUI is the one used.
  • When PPMode is switched to ±3 while PPLimit is 0, Hybrid sets PPLimit to 4, the script's value for those modes.
  • The interlace setting is always written: on when the current stream is not progressive. With it Hybrid also passes the field order of the source (detected or overwritten scan type) for the field separation: bottom field first only for a BFF stream, otherwise top field first.
  • Detail and PPLimit are entered on the 8-bit scale; the script scales them to the clip's bit depth.
  • The smoothed resize on the Resize tab also uses BlindDeHalo3 internally, with default settings and its own strength.
  • BlindDeHalo3 also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Background

The script

BlindDeHalo3 is a port of Didée's AviSynth script (version 3_MT2). Its interlace option is meant for material that was interlaced and later deinterlaced (for example through Restore24): the fields are separated in the given field order (top field first by default), processed and woven back together. Apart from the optional zsmooth median it needs only core functions.

Sources