Variable blur bug in newest version of IM

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
pedery
Posts: 2
Joined: 2012-02-27T18:20:07-07:00
Authentication code: 8675308

Variable blur bug in newest version of IM

Post by pedery »

I was attempting this effect verbatim, even using the same images:

http://www.imagemagick.org/Usage/photos/#tilt_shift

However, the blur function seems to be stuck on a minimum value. So even using variable blur with a completely black image, it still gets blurred. I've banged my head against the wall the entire day trying to figure out why the images had a blur to them no matter what I did.

The solution turned out to be to revert to version 6.5.4. I haven't tested the versions in between, but chose the version that was mentioned on this page:

http://www.imagemagick.org/Usage/mapping/#blur


- Peder -
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Variable blur bug in newest version of IM

Post by anthony »

The minimal aspect of the blur function is broken. (working sigma falls below 1.0) Always has been.
I know the cause but have not been able to fix it. It will get fixed, but their is no ETA.

Their was a angle bug that was fixed in version 6.5.8-8 but that should not have effected the minimum limit problem.


Version 6.5.4 was when variable blur (-compose Blur) was actually implemented. It did not exist before that!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
pedery
Posts: 2
Joined: 2012-02-27T18:20:07-07:00
Authentication code: 8675308

Re: Variable blur bug in newest version of IM

Post by pedery »

Well, like I said, it works with 6.5.4 and does not work on the newest build (Windows). If I variable-blur with a black image, it still gets blurred similar to a Gaussian blur with radius 2. Maybe it's a setting somewhere. In any case, your cool tilt-shift cannot be reproduced.


- Peder -
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Variable blur bug in newest version of IM

Post by anthony »

Can you give a command line example. Maybe I am mos-interpreting the question.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
einarjh
Posts: 1
Joined: 2012-04-21T10:31:06-07:00
Authentication code: 13

Re: Variable blur bug in newest version of IM

Post by einarjh »

I can confirm this bug. I followed the instructions in this example: http://www.imagemagick.org/Usage/mapping/#blur

And came out with this result:
Image

Compare to expected result:
Image

Using Fedora 16:

Code: Select all

einar@hactar:~$ convert -version
Version: ImageMagick 6.7.0-10 2011-11-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Variable blur bug in newest version of IM

Post by fmw42 »

Just confirming. I get the same incorrect result also on IM 6.7.6.6 Q16 Mac OSX Snow Leopard.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Variable blur bug in newest version of IM

Post by magick »

Anthony changed the resampling filter from GaussianFilter@1.0 to CubicFilter@2.0. When we restore the resampling filter, it matches the expected results. Anthony, can you 'splain the change from Gaussian to Cubic? It appears that Gaussian/Mtichell returns the expected results but Cubic blurs the masked pixels.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Variable blur bug in newest version of IM

Post by anthony »

I'll try and take a look at it tonight. comparing code between versions.

The minimal blur issue is with blurs that get small enough that support size no longer can see neighbouring pixels.
This usually happens at sigma=0.5 which is relativity easy to reach when using variable blur maps.

But teh example shown is just a boolean on/off blur mask rather than a blur map. a sigma issue should not effect that as the blur is either on or not.

The two example images appear to show that it is blurring horizontally but not vertically.
As EWA is used for the blurring that means we are getting elliptical blurs, rather than circular blurs.

UPDATE: Actually it was simply only blurred half as much as it should have been! See next post.

I'll have to check it out and see what internal variables it is using.

Thanks for reporting!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Variable blur bug in newest version of IM

Post by anthony »

Yesterday I used the ANZAC public holiday (tribute day to Australian and New Zealand war veterans) to trace the bug in Variable Blurring. This discovered that the 'Gaussian' Filter was using a Sigma of about 0.25 (not exact) instead of 0.5.

The cause was some stupid programming faults (the code reads okay, but two if statements always comes out as true!). This stuffed up the 'sigma expert setting', and resulted in an incorrect default value for sigma value used. This was compounded by the verbose filter report summary not showing the fault!

As such Gaussian Filters were not blurry enough, and acted more like a 'hermite', ever since user sigma control was added (Feburary Last year, IM v6.6.7-6) :oops:



Now if I can just prevent filter expert settings effecting variable blurs, AND allow it to NOT use a 0.5 blur on image area that should have 'No Blur' according to the variable blur mapping! The later is causes by EWA 'minimal radius' handling, which is needed for resampling but not for blurring. It is what I get for 'abusing' EWA resampling to do per-pixel blurring. :?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply