Variable motion blur mapping?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
josephs
Posts: 40
Joined: 2014-04-08T10:13:43-07:00
Authentication code: 6789

Variable motion blur mapping?

Post by josephs » 2018-12-24T15:22:11-07:00

Hi All,

I have read this example for the ImageMagick example pages:

convert -size 75x75 gradient:black-white blur_map_gradient.gif
convert koala.gif blur_map_gradient.gif \
-compose blur -define compose:args=3 -composite \
blur_koala_gradient.gif

...as explained in example pages, this will make the image progressively more blurry from top of image to bottom of image.

I am curious to know if this same idea be applied using motion blur, for example using '-morphology Convolve Blur:0x4'? In other words the motion blur is progressively applied?

I am tinkering with a cool effect to make objects in the foreground move faster across the page then objects in the background.

As always any help is appreciated.

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

Re: Variable motion blur mapping?

Post by fmw42 » 2018-12-24T16:11:49-07:00

No, I do not believe it can be used with motion blur. The point of using variable blur is that it can make something like motion blur. I think you can localize the variable blur by masking your gradient to the shape of the region you want to blur.

snibgo
Posts: 11796
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Variable motion blur mapping?

Post by snibgo » 2018-12-24T16:46:28-07:00

"-morphology Convolve Blur" can't use a second image as a mask to determine the blur sigma.

For "-compose Blur", the "args" parameter can take separate numbers for x-sigma and y-sigma, and the angle. The angle can be modulated by the blue channel of the mask. For example (Windows BAT syntax):

Code: Select all

%IMG7%magick ^
  toes.png ^
  ( +clone ^
    -sparse-color bilinear 0,0,#000,0,%%[fx:h-1],#fff ^
  ) ^
  -compose blur -define compose:args=10x0-20-20 -composite ^
  motblur_m.jpg
Image

See also Selective blur
snibgo's IM pages: im.snibgo.com

josephs
Posts: 40
Joined: 2014-04-08T10:13:43-07:00
Authentication code: 6789

Re: Variable motion blur mapping?

Post by josephs » 2018-12-25T10:31:40-07:00

Thank you! Brilliant. Much appreciated.

Post Reply