LimitedSharpen
From Avisynth wiki
Contents |
Abstract | |
---|---|
Author | Didée |
Version | 2.0b |
Download | LimitedSharpenFaster.avs |
Category | Sharpeners |
Requirements |
|
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.
- MaskTools 1.5x
- MaskTools2 2a48+
- RemoveGrain v1.0b (Do not use SSE3 or it'll crash)
- WarpSharp for UnsharpMask | warpsharp_20080325.7z
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:
- 1 : UnsharpMask
- 2 : Sharpen
- 3 : Range sharpening.
- 4 : nonlinear sharpening.
- Each mode has progressively less haloing in its sharpening.
- Sharpen mode:
- Smode int (1-4, default 3)
- ss_x float = 1.5
- ss_y float = 1.5
- Supersampling when > 1, which reduces aliasing on edges.
- ss_x float = 1.5
- dest_x float = width
- dest_y float = height
- Resize directly to final size, saves a resize step.
- dest_x float = width
- 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.
- Sharpening strength:
- strength int = 160
- radius int (1-10, default 1)
- Radius of UnsharpMask, only used in Smode=1.
- radius int (1-10, default 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.)
- overshoot int = 1
- undershoot int = [overshoot]
- Separate limit for pixels that get darker during sharpening. Good for cartoons with strong lines. (If not specified, then undershoot==overshoot.)
- undershoot int = [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.
- Lmode:
- Lmode int (0-3, default 1)
- soft int (0-100, default 0)
- Softens the effect of sharpening. -1 will (try to) autocalculate a good value.
- soft int (0-100, default 0)
- 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?)
- edgemode int (-1 to 2, default 0)
- 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.)
- special bool = false
- 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.
- wide bool = false
- exborder int (0-16, default 0)
- exborder int (0-16, default 0)
Examples
avisource("Blah.avi") LimitedSharpenFaster()
Changelog
External Links
- Download LimitedSharpenFaster.avs : Current version, using masktools2.
- Advanced version, alias "v3.x" : LSFmod
- LimitedSharpen thread in Doom9