possible bug in -adaptive-blur IM 6.5.0-2 Q16

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

possible bug in -adaptive-blur IM 6.5.0-2 Q16

Post by fmw42 »

IM 6.5.0-2 Q16 Mac OSX Tiger

I was playing with -adaptive-blur for the first time with respect to the comments made at viewtopic.php?f=1&t=13365

Here is the definition from the options page:
-adaptive-blur radius[xsigma]

Adaptively blur pixels, with decreasing effect near edges.
A Gaussian operator of the given radius and standard deviation (sigma) is used. If sigma is not given it defaults to 1.
It seems to me that it is really more of an adaptive-sharpening than an adaptive-blur. Here are my test results.

original image
Image

convert lena.jpg -adaptive-blur 0,1 lena_ablur_0x1.jpg
Image

convert lena.jpg -adaptive-blur 0,3 lena_ablur_0x3.jpg
Image


Looking at her hair and hat band, it seem that the detail is being sharpened closer one gets to the edges and I see not blurring away from the edges.

Is this a bug or is the description and name of the function in error?

Look forward to your new selective-blur.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug in -adaptive-blur IM 6.5.0-2 Q16

Post by magick »

We can reproduce the problem and have a fix in the latest ImageMagick release, 6.5.0-3.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug in -adaptive-blur IM 6.5.0-2 Q16

Post by fmw42 »

The fix in IM 6.5.0-3 has changed from sharpening to blurring, BUT does not seem to do anything much more than a global blur. It is not preserving the edges very well. This is not to say it is not correct, only that it appears not to be very effective at least for this image.

Here are the new tests:

original
Image

convert lena.jpg -adaptive-blur 0x1 lena_ablurnew_0x1.jpg
Image

convert lena.jpg -adaptive-blur 0x3 lena_ablurnew_0x3.jpg
Image


Here are simple gaussian blurs for comparison.

convert lena.jpg -blur 0x1 lena_blur_0x1.jpg
Image

convert lena.jpg -blur 0x3 lena_blur_0x3.jpg
Image


There seems to be very little preservation of the edges in the adaptive-blur.
Post Reply