Log in

View Full Version : script: soft thresholded temporalsoften


Mug Funky
25th March 2004, 16:00
duh... basically a quick hack of another script replacing a blur with a temporal soften.

perhaps a useful concept, but in reality doesn't look much different to temporalsoften (eliminates the banding on moving gradients, but injudicious use will introduce a slew of different artefacts)


function temporalFunk (clip c, int "cut", int "rolloff", int "gamma", int "radius")
{

radius=default(radius,4)
cut=default(cut,129)
rolloff=default(rolloff,30)
gamma=default(gamma,3)

soft = c.temporalsoften(radius,255,255,24,2)

temp_mask = overlay(soft,c,mode="difference")
temp_mask = temp_mask.levels(cut,gamma,cut+rolloff,0,255,coring=false)

overlay(soft,c,mask=temp_mask)

}



radius = radius parameter in temporalsoften. number of frames before and after the current to be considered.

cut = motionmask cutoff. should be 128 and above (default 129). values below are of dubious usefullness, and higher values will let through smearing.

rolloff = number of luma values above cutoff that mask lets only blurred pixels through. default 30, possibly should be lowered (definitely for clean sources)

gamma = gamma correction of mask. high values keep more of the original (non blurred) image. values above 5 are pointless as you might as well use regular temporalsoften. default is 3 to prevent odd blended smears (experimental).