Soften
Raffriff42 (Talk | contribs) (formatting, links, phrasing) |
(add link to avs+ documentation) |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
<div style="max-width:68em" > | <div style="max-width:68em" > | ||
+ | |||
+ | <div {{BlueBox2|40|0|3px solid purple}} > | ||
+ | {{AvsPlusFullname}}<br> | ||
+ | Up-to-date documentation: [https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/soften.html https://avisynthplus.readthedocs.io] | ||
+ | </div> | ||
+ | |||
+ | |||
'''SpatialSoften''' and '''TemporalSoften''' remove noise from a video clip by selectively blending pixels. | '''SpatialSoften''' and '''TemporalSoften''' remove noise from a video clip by selectively blending pixels. | ||
Line 28: | Line 35: | ||
}} | }} | ||
− | Blends corresponding pixels in neighboring frames. All frames no more than {{FuncArg|radius}} away are examined. Blending occurs only if corresponding pixels are within {{FuncArg|luma_threshold}} or {{FuncArg|chroma_threshold}}, as explained below. | + | Blends corresponding pixels in neighboring frames. All frames no more than {{FuncArg|radius}} away are examined. Blending occurs only if corresponding pixels are within {{FuncArg|luma_threshold}} or {{FuncArg|chroma_threshold}}, as explained below. |
+ | |||
+ | {{AvsPluscon}} arguments are [[Autoscale_parameter|autoscaling]] – they are always 0-255 at all bit depths. | ||
:{{Par2|clip|clip|}} | :{{Par2|clip|clip|}} | ||
− | :: Source clip. Supported color formats: all except [[RGB24]] | + | :: Source clip. Supported color formats: all except [[RGB24]] and [[Avisynthplus_color_formats|RGB48]] |
:{{Par2|radius|int|}} | :{{Par2|radius|int|}} | ||
Line 50: | Line 59: | ||
::Defines the maximum average pixel change between frames; set properly, this will avoid blending across scene changes. | ::Defines the maximum average pixel change between frames; set properly, this will avoid blending across scene changes. | ||
::*Good values are between 5 and 30, somewhat higher than {{FuncArg|luma_threshold}}. | ::*Good values are between 5 and 30, somewhat higher than {{FuncArg|luma_threshold}}. | ||
+ | ::*{{FuncArg|scenechange}} not supported in RGB modes. | ||
:{{Par2|mode|int|1}} | :{{Par2|mode|int|1}} |
Latest revision as of 19:15, 17 September 2022
AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io
SpatialSoften and TemporalSoften remove noise from a video clip by selectively blending pixels.
Contents |
[edit] Syntax and Parameters
SpatialSoften(clip clip, int radius, int luma_threshold, int chroma_threshold)
Like Blur, SpatialSoften blends neighboring pixels in the frame – but with a wider possible radius, and only if neighboring pixels are within luma_threshold and chroma_threshold, as explained below.
- clip clip =
- Source clip. Must be YUY2 color format.
- int radius =
- Filter radius – defines which pixels are processed.
- Range 0-32; radius=0 results in no smoothing. Values > 32 may cause AviSynth to crash.
- int luma_threshold, chroma_threshold =
- When smoothing a given pixel P, SpatialSoften ignores any neighbor pixel Pn where:
- Pn luma differs from P luma by more than luma_threshold, OR
- Pn chroma differs from P chroma by more than chroma_threshold.
- When smoothing a given pixel P, SpatialSoften ignores any neighbor pixel Pn where:
TemporalSoften(clip clip, int radius, int luma_threshold, int chroma_threshold [, int scenechange] [, int mode ] )
Blends corresponding pixels in neighboring frames. All frames no more than radius away are examined. Blending occurs only if corresponding pixels are within luma_threshold or chroma_threshold, as explained below.
AVS+ arguments are autoscaling – they are always 0-255 at all bit depths.
- int radius =
- Filter radius. All frames no more than radius from the current frame are examined.
- (for radius=2, FIVE frames are processed: the current frame, two ahead and two behind)
- Range 0-7; radius=0 results in no smoothing.
- int luma_threshold =
- When smoothing a given luma pixel Y, the corresponding pixel in neighboring frame Yn
- is ignored where Yn differs from Y by more than luma_threshold.
- int chroma_threshold =
- When smoothing a given chroma pixel C, the corresponding pixel in neighboring frame Cn
- is ignored where Cn differs from C by more than chroma_threshold.
- Good starting values are around 1 or 2 times luma_threshold.
- int scenechange = 0
- Defines the maximum average pixel change between frames; set properly, this will avoid blending across scene changes.
- Good values are between 5 and 30, somewhat higher than luma_threshold.
- scenechange not supported in RGB modes.
- Defines the maximum average pixel change between frames; set properly, this will avoid blending across scene changes.
- int mode = 1
- New scripts should specify mode=2 to enable ISSE processing. For backward compatibility, mode=1 by default.
[edit] Examples
- Good initial values:
TemporalSoften(3, 4, 8, scenechange=15, mode=2)
[edit] Changes
v2.56 | TemporalSoften working also with RGB32 input (as well as YV12, YUY2) |