Eliminating virtual pixels for initiation unidirectional motion blur #7197
-
ImageMagick version7.1.0-62-Q16 Operating system, version and so onWindows 10 DescriptionHere is what I have and works well: -virtual-pixel edge -morphology convolve comet:0x500+90 . . . but the problem lies in the initiation of the motion blur, specifically at the top edge. Currently, IM is utilizing pixel data from above the image's top edge to begin the motion blur at the top edge. While I grasp this concept, it doesn't align with what I require. I need the motion blur to begin precisely at the top edge, without any calculations referencing data above it. Think of it as placing a paintbrush at the top edge and smoothly dragging it downwards, ensuring that all color information originates from the top edge and not from above it. Any help is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The pixels in the output image near the top edge have to come from somewhere. We can make that "somewhere" transparent, then composite the output over the input, like this:
Does that do what you want? |
Beta Was this translation helpful? Give feedback.
-
I've experimented further with the suggestion provided, and while it does function, I'm still in search of a more refined outcome. Interestingly, during my exploration, I stumbled upon a technique referred to as "graduated blur" on another website, which seems to align more closely with my desired effect. Specifically, I noticed that the motion blur initiates from the top edge of the image and excludes pixel information located above the image. Do you have any insights on how this effect can be achieved in ImageMagick? Any guidance, even if it's just pointing me in the right direction, would be immensely appreciated! https://gmic.eu/oldtutorial/dyidiffusion_graduated-blurs.shtml |
Beta Was this translation helpful? Give feedback.
-
As that G'MIC page says, ImageMagick has For your case:
This is Windows CMD syntax. For Windows BAT syntax, double each This makes a gradient image that is black at the top and white at the bottom, the same size as the input image. This is used as a mask for a blur that has sigma=0 in the x-direction (ie no blur), and sigma=50 in the y-direction. This is fast enough for web-sized images. For 35m pixel images, it takes a long time, eg 30 minutes. If that is not acceptable, we can resize the input down, do the graduated blur, and resize up. |
Beta Was this translation helpful? Give feedback.
As that G'MIC page says, ImageMagick has
-compose Blur -composite
, which uses an image to vary the amount of blur. See my page Selective blur for examples.For your case:
This is Windows CMD syntax. For Windows BAT syntax, double each
%
to%%
.This makes a gradient image that is black at the top and white at the bottom, the same size as the input image. This is used as a mask for a blur that has sigma=0 in the x-direction (ie no blur), and sigma=50 in the y-direction.
This is fast enough for web-sized images. For 35m pixel im…