Avisynth Blur

From wiki.selur.net
Jump to navigation Jump to search

Blur is a very simple 3×3 blur. One strength value (or one per direction) softens the picture; negative values sharpen it instead. It is a core filter of AviSynth+, no plugin is needed.

Filtering → Avisynth → Sharpen

Blur controls in Hybrid
Blur controls in Hybrid

What it does

Blur mixes each pixel with its horizontal and vertical neighbours using a small kernel. The kernel is [(1 − 1/2^a)/2, 1/2^a, (1 − 1/2^a)/2], where a is the amount:

  • 0 leaves the picture unchanged.
  • 1.0 gives the weights ¼, ½, ¼.
  • About 1.58 (log₂ 3) gives equal weights, i.e. a 3-pixel box blur.
  • Negative values down to −1.0 sharpen. AviSynth+ offers this as the separate Sharpen filter, with Sharpen(n) equal to Blur(−n).

Applying Blur(1.0) repeatedly approximates a binomial blur. It is cheap and works on every color format.

Settings

Control Parameter Range Hybrid default Meaning
Amount amount −1.0–1.58 0.00 Blur strength, used for both directions. At 0 the picture does not change. Disabled while Amount (H/V) is on.
Amount (H/V) amounth / amountv −1.0–1.58 off; 0.00 / 0.00 Check box. When on, two separate values (horizontal and vertical) replace the single Amount. For example 0 / 1 blurs vertically only.

Example

Default settings on a 10-bit YUV 4:2:0 source. Blur works at any bit depth, so Hybrid adds no conversion. At amount 0 the picture is unchanged; set Amount above 0 to blur:

Blur(0.00)

How Hybrid calls it

  • Writes Blur(amount), or Blur(amountH, amountV) when Amount (H/V) is on. The values are always written, even at 0.
  • Blur works on all color spaces and bit depths, so Hybrid inserts no conversion.
  • Blur also offers the common options and can be added to the filter queue several times.

Background

  • The filter handles 8–32 bit planar YUV and RGB with alpha, as well as packed RGB32 and RGB64.
  • If only one value is given, it is used for both directions.
  • A deprecated mmx argument exists and is ignored.
  • Hybrid offers no separate Sharpen filter; use a negative Blur amount instead.

Sources