LimitedSharpen

From Avisynth wiki
Revision as of 23:15, 26 September 2014 by Reel.Deal (Talk | contribs)

Jump to: navigation, search

Contents

Abstract
Author Didée
Version 2.0b
Download LimitedSharpenFaster.avs
Category Sharpeners
Requirements
  • YV12
License
Discussion Doom9 Thread

Abstract

Applies a strong sharpening to edges and fine details by controlling halos and minimising artifacts. All sharpening is a 3-way struggle between edge-halos, edge-aliasing, and confetti artifacts; LimitedSharpen is an attempt to minimize each in the most visually pleasing way. For a similar filter that integrates denoising and sharpening into a single step, look at SeeSaw.


Required Plugins

Latest version of the following plugins are recommended unless stated otherwise.


Syntax and Parameters

This should be used as the last filter in a chain if possible, like any sharpener. The different Smodes cause different defaults to be used in certain cases, or limit the ranges differently. See the source for specifics.


LimitedSharpen(clip clp, float ss_x, float ss_y, int dest_x, int dest_y, int Smode, int strength, int radius, int Lmode, bool wide, int overshoot, int undershoot, int soft, int edgemode, bool special, int exborder)
Smode int (1-4, default 3)
Sharpen mode:
Each mode has progressively less haloing in its sharpening.
ss_x float = 1.5
ss_y float = 1.5
Supersampling when > 1, which reduces aliasing on edges.
dest_x float = width
dest_y float = height
Resize directly to final size, saves a resize step.
strength int = 160
Sharpening strength:
  • For Smode=1, it can be 0~127 (simple sharpening), 128~255 (simple overdrive), 255~4096 (big overdrive).
  • For Smode=2, values 0~100 are handled over to Sharpen() as 0.0~1.0. Values >100 are mapped to 100.
  • For Smode=3, 0~100 is common, but 100~inf. can be used if necessary.
Default is strength=160 for Smode=1, and strength=100 otherwise.
radius int (1-10, default 1)
Radius of UnsharpMask, only used in Smode=1.
overshoot int = 1
Sharpening limit: a sharpened pixel may not exceed [min,max] of the local neighborhood by more than 'overshoot'.
(High values remove the "Limited" of LimitedSharpen, and cause excessive haloing.)
undershoot int = [overshoot]
Separate limit for pixels that get darker during sharpening. Good for cartoons with strong lines. (If not specified, then undershoot==overshoot.)
Lmode int (0-3, default 1)
Lmode:
  • 0 : No effect
  • 1 : Clamp to over/undershoot.
  • 3 : Zero over/undershoot on edges, normal over/undershoot on not-edges.
soft int (0-100, default 0)
Softens the effect of sharpening. -1 will (try to) autocalculate a good value.
edgemode int (-1 to 2, default 0)
  • -1 : shows edges.
  • 0 : does nothing.
  • 1 : restricts sharpening to edges
  • 2 : restricts sharpening to mostly non-edges (I think?)
special bool = false
special=true tries to raise detail contrast in dark areas of a frame.
(Usage not really recommended - the method is simple and might cause artefacts.)
wide bool = false
With wide=true, the local [min,max] limits are gathered from the 5x5 neighborhood, instead just 3x3.
Enables more gain in detail contrast. Increasingly useful with increasing supersampling factors.
exborder int (0-16, default 0)


Examples

avisource("Blah.avi")
LimitedSharpenFaster()


Changelog

External Links

Personal tools