Log in

View Full Version : blur in one direction


mathmax
20th December 2011, 01:28
Hi

Is there a way to blur in only one direction? Not only horizontally.. but from the left to the right.

Thank you in advance for any tips :)

Guest
20th December 2011, 03:04
You can create that using GeneralConvolution().

http://avisynth.org/mediawiki/GeneralConvolution

GeneralConvolution(0, "0 0 0 0 1 1 0 0 0", 2, false) # 3x3 kernel

That's just a simple example. You can make any asymmetric 3x3 or 5x5 kernel that you like.

mathmax
20th December 2011, 10:19
thank you :)

Is there a way to set a matrix of thresholds ? So that, if a value differ more than the corresponding threshold, it would be either ignored or replaced by the central value.

Also, is it possible to perform separately on luma and chroma ?

Gavino
20th December 2011, 10:56
Also, is it possible to perform separately on luma and chroma ?
Apply the operation twice with required arguments for luma and chroma respectively, then use MergeChroma(lumaResult, chromaResult).

Guest
20th December 2011, 16:01
Is there a way to set a matrix of thresholds ? So that, if a value differ more than the corresponding threshold, it would be either ignored or replaced by the central value. Not with GeneralConvolution(). I would hack out a quick native filter for that if it was me, though maybe some extreme scripting could do it too.

mathmax
20th December 2011, 17:14
Apply the operation twice with required arguments for luma and chroma respectively, then use MergeChroma(lumaResult, chromaResult).
Thank you for the advice, but I don't see any argument for luma and chroma..

Not with GeneralConvolution(). I would hack out a quick native filter for that if it was me, though maybe some extreme scripting could do it too.
Which quick native filter would you hack and how?
mt_mappedblur() (http://manao4.free.fr/mt_masktools.html#mt_mappedblur) does that I think but it's for mask.. :-/
What about convolution3D()?

Gavino
20th December 2011, 17:47
Thank you for the advice, but I don't see any argument for luma and chroma..
It's not that the filter has different arguments for luma and chroma - you call it twice, once with the arguments you want to apply to luma, and again for chroma. If you don't want to process chroma at all, use the original clip in MergeChroma to restore the unprocessed chroma.

This technique is completely general and applies to any filter that accepts YUV input.

Guest
20th December 2011, 19:08
Which quick native filter would you hack and how? I just meant I would whip up a quick native filter. You could use any of many possible existing filter sources as a starting point.

mathmax
20th December 2011, 20:26
I just meant I would whip up a quick native filter. You could use any of many possible existing filter sources as a starting point.
I would really love to code my own filter... but I never did that and I don't know how to begin... :-/
Would you give me some hints to start? Which native filter would you modify?

Guest
20th December 2011, 21:17
http://forum.doom9.org/showthread.php?t=48261