@ travolter
Well, it's tricky. The best way to "not overdo" the effect is .... to not overdo the effect.
It could help to use some "parallel-path denoising", see
here. Though, it depends on the temporal characteristic of those unwanted spots. If they are fluctuating, good. If they are persistent/static, bad luck.
It would also help to use stronger low-damping (not parametrized, it's the "0.001 +" term in the lut that would need to be increased). However, while this will reduce emphasizing of unwanted spots, it
necessarily will
also reduce the emphasizing of spots where the effect is actually welcome. Old story: there is a small pixel variation. Is it noise? Is it detail? Simple algorithms can't tell -- it's just that: a small pixel variation.
@ lisztfr9
Code:
function NonlinUSM(clip o, float "z", float "pow", float "str", float "rad", float "ldmp")
{
z = default(z, 6.0) # zero point
pow = default(pow, 1.6) # power
str = default(str, 1.0) # strength
rad = default(rad, 9.0) # radius for "gauss"
ldmp= default(ldmp, 0.001) # damping for verysmall differences
g = o.bicubicresize(round(o.width()/rad/4)*4,round(o.height()/rad/4)*4).bicubicresize(o.width(),o.height(),1,0)
mt_lutxy(o,g,"x x y - abs "+string(z)+" / 1 "+string(pow)+" / ^ "+string(z)+" * "+string(str)+
\ " * x y - 2 ^ x y - 2 ^ "+string(ldmp)+" + / * x y - x y - abs 0.001 + / * +",U=2,V=2)
#interleave(o,last) # just for visualisation, you don't want the function to do this
return(last)
}
Note that I renamed the function to "NonlinUSM" (for "non-linear Unsharp Masking"). The name in itself doesn't matter, you could as well name it MickeyMouse() or BlueElephant() if you wanted. But since the function "sharpen2" is already used in SeeSaw, it seems better to use
any other name, in order to avoid possible conflicts.