motion-blur may still have a bug in IM 6.4.0-11

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

motion-blur may still have a bug in IM 6.4.0-11

Post by fmw42 »

For reference see viewtopic.php?f=3&t=11122

In IM 6.4.0-11 Q16-hdri (Mac OSX Tiger PPC), motion blur is now appearing offset to the left and possibly too wide and/or sloped wrong for the filter radiusxsigma, but the filtered result does correctly produce a linear profile for its sides, now.

Here is the original image:
Image

Here is the result using radiusxsigma+angle = 0x5+0 which I would assume would create a horizontal blur about 15 pixels wide (as the filter width in other similar functions mentions that radius=0 produces a filter width about 3xsigma)
Image

Here is the profile of the above:
Image

If I reduce the parameter to 0x3+0, I get:
Image

and its profile is:
Image


Here is a correct motion blur for a 15 pixel horizontal blur (using -convolve):
Image

and its profile is:
Image


This is not urgent as I can get around it for reasonable size horizontal blurs using -convolve. But I wanted to give you feedback as you attempted to fix it for IM 6.4.0-11. Eventually it would be nice to have it correct so that I can more easily generate motion-blur at an arbitrary angle. (Can you clarify how the width and slope are determined? They should duplicate the result for -convolve with a 15x15 horizontal line filter, I would hope/expect?, for 0x5+0. Am I expecting too much due to the implementation method?)

For reference, here is how I generated the -convolve example:
filt15="\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\
"
convert square31.png -convolve $filt15 square31_IM_filt15.png


Thanks

Fred
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: motion-blur may still have a bug in IM 6.4.0-11

Post by magick »

We can reproduce the problem and will have a patch in ImageMagick 6.4.1-0 sometime tomorrow.
Post Reply