WarpSharp/UnsharpMask

From Avisynth wiki
Jump to: navigation, search

Sharpening filter like VirtualDub's UnsharpMask. This filter implements a well-known contrast enhancement/sharpening technique called unsharp masking. The basic idea is that a blurred version of the original image is created and then subtracted from the original image. The resulting image will have contrast boosts around features in the image. The result is a very pleasing sharpening that is superior to simple sharpening with a convolution kernel or high-pass boost.

Syntax and Parameters

UnsharpMask (clip, int "strength", int "radius", int "threshold")


clip   =
Input clip.


int  strength = 64
This option determines the amount of enhancement. This option does not affect running time.


int  radius = 3
This option determines the size of the neighborhood around a pixel over which a neighborhood average is determined. The pixel is replaced with this average to implement blurring. It must be an odd number. Running time will be increased as the radius is increased. Small values such as 3 and 5 are fine for most applications.


int  threshold = 8
This option sets how different pixels must be from their neighborhood average before they are subjected to sharpening. For example, sometimes with strong sharpening, what should be smooth areas (such as skin) develop undesirable features or contours. By setting an appropriate threshold, these areas can be excluded from the enhancement process. Thresholding slightly decreases running time.


Examples

UnsharpMask with default settings:

AviSource("Blah.avi")
UnsharpMask(strength=64, radius=3, threshold=8) 



Back to WarpSharp

Personal tools