Zoom Blur
Zoom Blur
Greetings,
Can anyone recommend an approach to creating a zoom blur type filter?
The effect is similar to a motion blur, but has a center and the blur are rays from the center.
Any suggestions would be greatly appreciated!
Thank you.
Can anyone recommend an approach to creating a zoom blur type filter?
The effect is similar to a motion blur, but has a center and the blur are rays from the center.
Any suggestions would be greatly appreciated!
Thank you.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Zoom Blur
see my zoomblur script at the link below. it iterates on zooming and blending. sorry it is a bash shell script. I don't know any of the IM APIs.
But IM now can do a variable blur, but I don't know if that is what you want. See http://www.imagemagick.org/Usage/mapping/#blur
But IM now can do a variable blur, but I don't know if that is what you want. See http://www.imagemagick.org/Usage/mapping/#blur
Re: Zoom Blur
Nice collection of scripts!
Do you know if it is possible to use the "convert" IM command from a C/C++ interface?
Do you know if it is possible to use the "convert" IM command from a C/C++ interface?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Zoom Blur
3DTOPO wrote:Nice collection of scripts!
Do you know if it is possible to use the "convert" IM command from a C/C++ interface?
You should be able to do the equivalent in C or C++, but some functions especially in C++ may not be fully implemented. I really don't know much for sure. But usually if something is missing, the IM folks will generally add it depending upon their time availability.
Unfortunately, you would have to take all my commands and convert them from command line format using convert to your API calls. Convert itself as far as I know does not exist per se in those APIs. But again I am not an expert on any of them.
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Zoom Blur
In the C API there is a function, ConvertImageCommand, which takes exactly the same arguments as the command line version.
Pete
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Zoom Blur
Pete,el_supremo wrote:In the C API there is a function, ConvertImageCommand, which takes exactly the same arguments as the command line version.
Pete
Thanks for correcting me.
Fred
Re: Zoom Blur
That is Excellent!el_supremo wrote:In the C API there is a function, ConvertImageCommand, which takes exactly the same arguments as the command line version.
Pete
Thank you very much both Fred and Pete!
Re: Zoom Blur
Hey Fred,
I was wondering if you knew of a way to get a "reverse fisheye" effect?
I tried entering negative values but they are not accepted from your script.
Example, original on the left, inverse fisheye on the right:
Thanks!
I was wondering if you knew of a way to get a "reverse fisheye" effect?
I tried entering negative values but they are not accepted from your script.
Example, original on the left, inverse fisheye on the right:
Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Zoom Blur
For a reverse fisheye type distortion, try my bubblewarp script with -t sin -m polar. Note my spherize script is the same, but faster and also more limited. So right now I trap for positive warp (outward sphere) only. I suspect I could relax that if you need it.
You can also see my pinbarrel script for examples. IM now has -distort barrel, so you can do something similar with it.
PS I forgot to mention that the order of my coefficients in pinbarrel is opposite to what was used by Anthony in -distort barrel and the apparent conventional ordering. Note -distort barrelinverse is not the inverse of -distort barrel. Its results are similar, but uses inverse radial powers rather than radial powers.
You can also see my pinbarrel script for examples. IM now has -distort barrel, so you can do something similar with it.
PS I forgot to mention that the order of my coefficients in pinbarrel is opposite to what was used by Anthony in -distort barrel and the apparent conventional ordering. Note -distort barrelinverse is not the inverse of -distort barrel. Its results are similar, but uses inverse radial powers rather than radial powers.
Re: Zoom Blur
Thanks Fred!fmw42 wrote:For a reverse fisheye type distortion, try my bubblewarp script with -t sin -m polar.
bubblwrap -t sin from your examples looks perfect!
But I am getting identical results using sin and arcsin which both appear to be an arcsin result.
I can show my test images if it might help....
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Zoom Blur
You found an oversight in my conversion of my test script to a formal script. I have corrected it now. You can download it from my web site or send me email (fmw at alink dot net) and I can send you the revised script.bubblwrap -t sin from your examples looks perfect!
But I am getting identical results using sin and arcsin which both appear to be an arcsin result.
Thanks for finding that and pointing it out. It has been there since the script was first posted and no one has commented on that.
Fred
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Zoom Blur
A new alternative for radile blurring is to use "Variable Blur Mapping".
http://www.imagemagick.org/Usage/mapping/#blur
With the right mapping file you can generate basically any type of blur effect you want.
How about a spiral blur? Or a mix of distortions (by whatever means) and blurring?
And please let us see your results (and source images) for your own mapping effects.
http://www.imagemagick.org/Usage/mapping/#blur
With the right mapping file you can generate basically any type of blur effect you want.
How about a spiral blur? Or a mix of distortions (by whatever means) and blurring?
And please let us see your results (and source images) for your own mapping effects.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Zoom Blur
for reverse fisheye type distortion, try
bubblewarp -t sin -m polar zelda3.jpg zelda3_bubble_sin.jpg
or
convert zelda3.jpg -distort barrel "0 0 -0.5 1.5" zelda3_pincushion.jpg
For radial blur, try
convert zelda3.jpg \( -size 128x128 radial-gradient: -negate \) \
-compose blur -set option:compose:args 5 -composite zelda3_radialbur_5.jpg
bubblewarp -t sin -m polar zelda3.jpg zelda3_bubble_sin.jpg
or
convert zelda3.jpg -distort barrel "0 0 -0.5 1.5" zelda3_pincushion.jpg
For radial blur, try
convert zelda3.jpg \( -size 128x128 radial-gradient: -negate \) \
-compose blur -set option:compose:args 5 -composite zelda3_radialbur_5.jpg
Re: Zoom Blur
Hi,
I'm using MagickWand and based on your post i were able to create radial-blur effect using code below:
Unfortunately the result is not exactly what i wanted:
http://screencast.com/t/yn2wpCbF
For some reason the center part of the image is blurred, where i expect it should be 0% blur at center.
Could you see anything I'm doing wrong? Or would you have any recommendation? Thanks in advance.
I'm using MagickWand and based on your post i were able to create radial-blur effect using code below:
Code: Select all
MagickWand* tWand = NewMagickWand();
MagickSetOption(tWand, "compose:args", "5");
MagickSetSize(tWand, w, h);
MagickReadImage(tWand, "radial-gradient:black-white");
MagickCompositeImage(mainWand, tWand, BlurCompositeOp, 0, 0);
DestroyMagickWand(tWand);
http://screencast.com/t/yn2wpCbF
For some reason the center part of the image is blurred, where i expect it should be 0% blur at center.
Could you see anything I'm doing wrong? Or would you have any recommendation? Thanks in advance.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Zoom Blur
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.
If you want to make the area near the center less blurred you will need to create a blur map of some kind.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/