Page 1 of 1

Motion Blur

Posted: 2008-08-02T22:54:00-07:00
by 00quick00
Hi,

I need to use ImageMagick to create a motion blur which should be almost identical to the effect in Paint.NET

Eg.

Image

Although I'm having a bit of a problem. I'm using the following command except it blurs the entire image and not the region, plus I've tried playing with the options but I can't get it it to render anything similar to the effect in Paint.NET.

convert -motion-blur 0x50+335 -region 100x100 test.jpg test.jpg

Re: Motion Blur

Posted: 2008-08-02T23:08:27-07:00
by fmw42
try -region 100x100+0+0

also note that IM motion blur is not symmetric. See http://www.fmwconcepts.com/imagemagick/ ... onvolution

Re: Motion Blur

Posted: 2008-08-02T23:18:37-07:00
by 00quick00
+0+0 also blurs the entire image.

convert -motion-blur 0x50+335 -region 100x100+0+0 test.jpg test.jpg

Re: Motion Blur

Posted: 2008-08-03T01:47:44-07:00
by fmw42
what version of IM are you using? the following works for me on 6.4.2-5 Q16

convert logo: -region 55x55+430+90 -motion-blur 20x65535+45 tmp.png
does a 20 pixel asymmetric linear blur of the region around the big star on the hat at a 45 degree angle


convert logo: -region 55x55+430+90 -motion-blur 0x20+45 tmp1.png
does an asymmetric gaussian blur

Note:

1) convert syntax usually needs the input image right after "convert"

2) It also looks like -region needs to be specified right after the input as when I do

convert logo: -motion-blur 10x65535 -region 40x40+120+50 tmp2.png

it blurs the whole image.

Re: Motion Blur

Posted: 2008-08-03T03:00:02-07:00
by 00quick00
Ah, region needs to be at the start of the command.

By the way can someone please do an example for me?

I've tried -region 101x86+39+47 to select the below box but it didn't really work.


http://img507.imageshack.us/img507/6615/regionuv1.png

Re: Motion Blur

Posted: 2008-08-03T05:22:48-07:00
by Bonzo
An example as requested 8)

Image

Code: Select all

convert flowers.jpg -region 100x100+90+90 -motion-blur 20x65535+45 tmp.png

Re: Motion Blur

Posted: 2008-08-03T05:52:13-07:00
by 00quick00
Ah never mind, it was just -region. The PHP script was calculating the width and height wrong. :)





Thanks for your help