LimitedSharpen: Difference between revisions
From Avisynth wiki
Jump to navigationJump to search
m 1 revision |
formatting |
||
| Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
{{ | {{FilterCat4|External_filters|Scripts|Adjustment_filters|Sharpeners}} | ||
{{Filter|Didée|2.0b|[[Media:LimitedSharpenFaster.avs|LimitedSharpenFaster.avs]]|Sharpeners| | {{Filter|Didée | ||
|2.0b | |||
|[[Media:LimitedSharpenFaster.avs|LimitedSharpenFaster.avs]] | |||
|Sharpeners | |||
| | |||
* YV12 | * YV12 | ||
| | |7=[http://forum.doom9.org/showthread.php?s=&threadid=84196 Doom9 Thread]}} | ||
== Abstract == | == 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.<br> | |||
*[[MaskTools]] 1.5x | *[[MaskTools]] 1.5x | ||
*[[MaskTools2]] | *[[MaskTools2]] 2a48+ | ||
*[[ | *[[RemoveGrain]] v1.0b (Do not use SSE3 or it'll crash) | ||
*[ | *WarpSharp for UnsharpMask | [http://web.archive.org/web/20120212062428/http://vfrmaniac.fushizen.eu/seraphy_mirror/warpsharp/bin/warpsharp_20080325.7z warpsharp_20080325.7z] | ||
== [[Script variables|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. | 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. | ||
{{Par|ss_x|float|1.5}} | :{{FuncDef|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'')}} | ||
{{Par|ss_y|float|1.5}} | |||
[[Supersampling]] when > 1, which reduces aliasing on edges. | ::{{ParR|Smode|int|3|1-4}} | ||
:::Sharpen mode: | |||
::::* 1 : [[WarpSharp|UnsharpMask]] | |||
::::* 2 : [[Sharpen]] | |||
::::* 3 : Range sharpening. | |||
::::* 4 : nonlinear sharpening. | |||
:::Each mode has progressively less haloing in its sharpening. | |||
::{{Par|ss_x|float|1.5}} | |||
::{{Par|ss_y|float|1.5}} | |||
:::[[Supersampling]] when > 1, which reduces aliasing on edges. | |||
::{{Par|dest_x|float|width}} | |||
::{{Par|dest_y|float|height}} | |||
:::Resize directly to final size, saves a resize step. | |||
{{Par| | ::{{Par|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. | |||
{{ | ::{{ParR|radius|int|1|1-10}} | ||
:::Radius of UnsharpMask, only used in Smode=1. | |||
{{ | ::{{Par|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.) | |||
{{Par| | ::{{Par|undershoot|int|[overshoot]}} | ||
:::Separate limit for pixels that get darker during sharpening. Good for cartoons with strong lines. (If not specified, then undershoot==overshoot.) | |||
{{ | ::{{ParR|Lmode|int|1|0-3}} | ||
:::Lmode: | |||
::::* 0 : No effect | |||
::::* 1 : Clamp to over/undershoot. | |||
::::* 3 : Zero over/undershoot on edges, normal over/undershoot on not-edges. | |||
{{ParR| | ::{{ParR|soft|int|0|0-100}} | ||
:::Softens the effect of sharpening. -1 will (try to) autocalculate a good value. | |||
{{ParR| | ::{{ParR|edgemode|int|0|-1 to 2}} | ||
::::* -1 : shows edges. | |||
::::* 0 : does nothing. | |||
::::* 1 : restricts sharpening to edges | |||
::::* 2 : restricts sharpening to mostly non-edges (I think?) | |||
{{ | ::{{Par|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.) | |||
{{Par| | ::{{Par|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. | |||
{{ | ::{{ParR|exborder|int|0|0-16}} | ||
== Examples == | == Examples == | ||
| Line 84: | Line 91: | ||
LimitedSharpenFaster() | LimitedSharpenFaster() | ||
</pre> | </pre> | ||
== Changelog == | == Changelog == | ||
==External Links == | |||
== Links == | |||
* Download [[Media:LimitedSharpenFaster.avs|LimitedSharpenFaster.avs]] : Current version, using masktools2.<br/> | * Download [[Media:LimitedSharpenFaster.avs|LimitedSharpenFaster.avs]] : Current version, using masktools2.<br/> | ||
* Advanced version, alias "v3.x" : [[LSFmod]] | * Advanced version, alias "v3.x" : [[LSFmod]] | ||
* [http://forum.doom9.org/showthread.php?s=&threadid=84196 LimitedSharpen thread in Doom9] | |||
* [http://forum.doom9.org/showthread.php?s=&threadid=84196 LimitedSharpen thread in | |||
Revision as of 00:15, 27 September 2014
| 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
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