Code: Select all
convert test.ppm -compose Multiply "Gaussian:0x2" test_by_gaussian.ppm
Code: Select all
convert test.ppm -compose Multiply "Gaussian:0x2" test_by_gaussian.ppm
You cannot do that per se in IM.convert test.ppm -compose Multiply "Gaussian:0x2" test_by_gaussian.ppm
Right, I was wondering if I could automagically get one, in much the same way that I can automagically create a canvas using "-size 64x64 canvas:black".You cannot do that.
1) there is no Gaussian:0x2 by itself
Right, I was hoping to do a multiply like in the rose example here http://www.imagemagick.org/Usage/compose/#multiply2) -compose is associated with -composite and requires two images, generally the same size.
I'm trying to multiply the magnitude component of the fourier transform of an image by a gaussian in order to obtained a blurred image on doing the inverse fourier transform. I mostly understand the relation between convolution in real space <=> multiplication by kernel in phase space. But I still think I'd like to do it the totally backwards multiplicative way (if I would like to blur at numerous different radii it ends up being faster because I can "save my previous work").3) What I presume you want is to convolve a (small) gaussian filter with the image (not multiply) using -either -convolve or -morphology convolve or one of the built in -morphology kernels or to use -blur or -gaussian-blur. You cannot multiply every point in an image by a 2D pattern. You generally convolve it. That means for each pixel, multiply it and its neighbors by the values in the small filter, sum the products and divide by the sum of the filter values. (actually that is correlation, but it is the same as convolution if the filter is symmetric with respect to 180 degree rotation).
See
http://homepages.inf.ed.ac.uk/rbf/HIPR2/convolve.htm
http://www.fmwconcepts.com/imagemagick/ ... tering.pdf
http://www.imagemagick.org/script/comma ... p#convolve
http://www.imagemagick.org/script/comma ... s.php#blur
http://www.imagemagick.org/script/comma ... ssian-blur
http://www.imagemagick.org/Usage/convolve/#gaussian
http://www.imagemagick.org/Usage/compose/
If you could explain a bit more detail about what you are trying to do or want to do, it would be more helpful and perhaps we can clarify further.
hwttdz wrote:More specifically, I'm looking at this:
http://imagemagick.org/Usage/fourier/#blurring
specifically the multiplication by circle/blurred circle.
You can get a image from a convolution kernel in a number of ways...hwttdz wrote:Right, I was wondering if I could automagically get one, in much the same way that I can automagically create a canvas using "-size 64x64 canvas:black".You cannot do that.
1) there is no Gaussian:0x2 by itself
They do not have to be the same size, but for multiply, parts not overlayed will be preserved as is.Right, I was hoping to do a multiply like in the rose example here http://www.imagemagick.org/Usage/compose/#multiply2) -compose is associated with -composite and requires two images, generally the same size.
Take a look at variable blur mapping...I would like to blur at numerous different radii it ends up being faster because I can "save my previous work".