Vapoursynth UnsharpMask

From wiki.selur.net
Revision as of 05:13, 15 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

UnsharpMask is classic unsharp masking: the detail difference between the picture and a blurred copy is boosted and added back.

Filtering → Vapoursynth → Sharpen

UnsharpMask controls in Hybrid
UnsharpMask controls in Hybrid

What it does

A box-blurred copy of the luma plane is subtracted from the original. Where the difference is larger than Threshold, the difference is scaled by Strength and added to the original; smaller differences are left alone, so flat noise is not amplified. Only luma is sharpened; chroma passes through unchanged.

Settings

Control Parameter Range / values Hybrid default Meaning
Strength strength 0 – 128 64 Amount, used as strength/128: 64 adds half of the detail difference, 128 all of it, 0 nothing.
Radius radius 1 – 128 3 Horizontal and vertical radius of the box blur; larger values boost coarser detail.
Threshold threshold 1 – 255 8 Smallest difference (8-bit scale) that is still sharpened.
Tools: Expr – akarin, cranexpr, std akarin (std without AVX2) Expression plugin.
Tools: BoxBlur – vszip, std vszip Box blur plugin.

Example

Default settings on a 10-bit YUV 4:2:0 source (640x356):

# sharpening using UnsharpMask
clip = sharpen.UnsharpMask(clip, tools={'expr': 'akarin', 'boxblur': 'vszip'})

How Hybrid calls it

  • UnsharpMask works on integer YUV clips with 8, 10, 12 or 16 bit; other formats are converted first.
  • Values are only written when they differ from 64 / 3 / 8, the script's own defaults.
  • Threshold stays on the 8-bit scale; the script scales it to the bit depth. Strength and Radius do not depend on the bit depth.
  • UnsharpMask also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).

Sources