Zoom Blur

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
siuying

Re: Zoom Blur

Post by siuying » 2010-12-22T23:36:39-07:00

anthony wrote:The very center isn't blured. but that is only a single pixel.

If you want to make the area near the center less blurred you will need to create a blur map of some kind.
Thank you for your input!

I tried to modified the gradient brightness:

Code: Select all

	MagickWand* tWand = NewMagickWand();
	MagickSetOption(tWand, "compose:args", "5");
	MagickSetSize(tWand, w, h);
	MagickReadImage(tWand, "radial-gradient:black-white");
	MagickBrightnessContrastImage(tWand, -50.0, 0.0);
	MagickCompositeImage(self.wand, tWand, BlurCompositeOp, 0, 0);
	DestroyMagickWand(tWand);
The created map:
Image

The applied result:
Image

The center area should be #000000 already, but for some reason some blur is still applied?

User avatar
fmw42
Posts: 25664
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Zoom Blur

Post by fmw42 » 2010-12-23T10:57:52-07:00

radial-gradient has a straight line profile, so it is only zero at the very center and goes linearly out from there to full white. in stead of using brightness-contrast (or perhaps in addition) you probably want to use -black-threshold so that all values below some percent (or value) go exactly to black. That will make a center circle that will be exactly black

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

Re: Zoom Blur

Post by anthony » 2010-12-23T15:55:27-07:00

Their is currently a minimum of a 0.5 pixel sized blur in the way the blur map is applied. :-(
This is caused by minimum support limits in Elliptical filter that is applied.

I have made some modifications to the filter handling that will let me fix this problem, but have not gotten around to it.
And with all the Christmas activities going on I am not certain when I will get around to fixing it.
It is however on my ToDo list.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

siuying

Re: Zoom Blur

Post by siuying » 2010-12-24T03:21:33-07:00

anthony wrote:Their is currently a minimum of a 0.5 pixel sized blur in the way the blur map is applied. :-(
This is caused by minimum support limits in Elliptical filter that is applied.

I have made some modifications to the filter handling that will let me fix this problem, but have not gotten around to it.
And with all the Christmas activities going on I am not certain when I will get around to fixing it.
It is however on my ToDo list.
Thank you very much! Good to know this could be fixed. Merry Christmas!! :D

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

Re: Zoom Blur

Post by anthony » 2011-04-07T00:11:33-07:00

Except the fix I finally did apply proved to cause IM to be far too slow, so was removed again.

I really need to try something else.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply