Motion Blur

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
00quick00

Motion Blur

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Motion Blur

Post by fmw42 »

try -region 100x100+0+0

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

Re: Motion Blur

Post by 00quick00 »

+0+0 also blurs the entire image.

convert -motion-blur 0x50+335 -region 100x100+0+0 test.jpg test.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Motion Blur

Post 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.
00quick00

Re: Motion Blur

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Motion Blur

Post by Bonzo »

An example as requested 8)

Image

Code: Select all

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

Re: Motion Blur

Post by 00quick00 »

Ah never mind, it was just -region. The PHP script was calculating the width and height wrong. :)





Thanks for your help
Post Reply