Soften
AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io
SpatialSoften and TemporalSoften remove noise from a video clip by selectively blending pixels.
Contents |
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.
Examples
- Good initial values:
TemporalSoften(3, 4, 8, scenechange=15, mode=2)
Changes
v2.56 | TemporalSoften working also with RGB32 input (as well as YV12, YUY2) |