TUnsharp

From Avisynth wiki
Jump to: navigation, search
Abstract
Author tritical
Version v0.9.3
Download [x86]: TUnsharpv093.zip

[x86/x64]: TUnsharp093.7z

Category Sharpeners
License GPLv2
Discussion Doom9 Thread

Contents

Description

TUnsharp is a basic sharpening filter that uses a couple different variations of unsharp masking and allows for controlled sharpening based on edge magnitude and min/max neighborhood value clipping. The real reason for its existence is that it sports a GUI with real time preview.

Requirements


Syntax and Parameters

TUnsharp (clip, int "strength", int "thresholdL", int "thresholdU", int "type", int "map", int "lim", int "radius", bool "gui")


clip   =
Input clip.


int  strength = 100
The strength of the sharpening. Range is from 0 to 512.


int  thresholdL = 2
The lower edge magnitude threshold. If the edge magnitude for a pixel is equal to or greater than thresholdL then it will be sharpened. Range is 0 to 255.


int  thresholdU = 40
The upper edge magnitude threshold. If the edge magnitude for a pixel is equal to or less than thresholdU then it will be sharpened. Range is from 0 to 255 and it must be at equal to or greater then thresholdL or the filter becomes a slow NOP.


int  type = 0
Sets the type of sharpening or unsharp masking operator. Current options:
  • 0 : linear (5 point)
  • 1 : linear (9 point)
  • 2 : teager
  • 3 : cubic
  • 4 : rational
  • 5 : subtract
  • 6 : Xsharpen


int  map = 0
Sets what type of output map if any. Current options:
  • 0 : no map
  • 1 : pixels to be sharpened shown as white on current frame.
  • 2 : binary map, pixels to be sharpened set to 255, others 0 on luma... all chroma set to 128.


int  lim = 2
If type less than 6, lim sets the maximum the final sharpened pixel value can deviate from the min/max of the original 9 pixel neighborhood of the original image. Range is from 0 to 256.
If type=6 (XSharpen), then lim sets the maximum difference between the current pixel and the min or max of the neighborhood (whichever is closer to the value of the current pixel) there can be and still have the pixel be mapped. If the difference is larger then lim, the pixel is passed through untouched and not mapped to the min or max of the neighborhood.


int  radius = 2
Sets the radius of smoothing for producing the blurred clip. The blurred clip is used for edge magnitude detection and for getting the values of the unsharp masking operators. Larger values will be slower but more effective against noise. Possible settings are 1, 2, 3.


bool  gui = false
Sets whether or not this instance of TUnsharp should have a GUI. Only one instance of TUnsharp at a time can have a GUI, but there can be multiple instances per script (as long as the others don't have a GUI, it will throw an error if you try to create a second instance with one).
The options included on the GUI are: strength, thresholdL, thresholdU, lim, type, and map
Tunsharp gui.png
Normal operation is you change an option on the GUI, then you must advance at least one frame in VDub to see the effect of the change. However, if you click the GUI's SHOW PREVIEW button, a new window will pop open with the current frame and allow for seeing changes real time as you alter the filter parameters. To change the current frame of the real time preview you must change the frame in the vdub window. The DEFAULTS button will reset all values to the values the filter was constructed with (i.e. either the defaults or the values you set in your AviSynth script). The OK button will close the dialog window and the preview window if it is open.


Examples

TUnsharp with default settings:

AviSource("Blah.avi")
TUnsharp(strength=100, thresholdL=2, thresholdU=40, type=0, map=0, lim=2, radius=2, gui=false)


Changelog

Version      Date(M/D/Y)      Changes
v0.9.3 05/24/2005 - Fixed a few remaining thread sync/exit problems, hopefully for the last time v0.9.2 05/01/2005 + Added XSharpen sharpening method v0.9.1 05/01/2005 - Fixed a lot of bugs related to the gui code (thread sync and thread exit problems) + Release version now works fine v0.9 10/24/2004 - Initial release


Archived Downloads

Version Download Mirror
v0.9.3 (x86/x64) TUnsharp093.7z TUnsharp093.7z /// MediaFire
v0.9.3 TUnsharpv093.zip TUnsharpv093.zip


External Links




Back to External Filters

Personal tools