fmw42 wrote:Still not sure I follow. Do you mean Width is the length (sigma) of the x axis of the ellipse and Height is the length (sigma) of the y axis of the ellipse? And that the actual lengths in width and height are 4 times the value specified as sigma is converted to radius (actual lengths)
Without rotation (the default with not + arguments in the "compose:args") that is it exactly.
You use the arguments to set height to 0.5 and width to whatever you want, and give a single rotation angle, and for the mapping image, a pure white image, the same size (no variability)
For example:
Code: Select all
convert logo: \( +clone -fill white -colorize 100% \) \
-define compose:args="20x0-30" -compose Blur -composite show:
Not height of ellipse is 0 but it will be clamped to sigma 0.25 (actually the ellipse support radius height is clamped to 1 so support to the radius is 2.0 so sigma reduces from 0.5 to 0.25)
Note this is a perfectly uniform blur, not a one directional 'smear' that you get with
-motion-blur
In many ways it is far better than motion blur!
When I get to it I'll add non-90 degree convolution rotations, especially 1D kernels (like comet or blur kernels). The 'hook' is present, I just need code to do the rotations of a floating point array (with appropriate array resize, and interpolation), and it can be done. Actually just about any good C programmer should be able to do it, it is just time that I have a problem with.
So there is no way I can control the radius independent of the sigma?
YES their is The expert filter settings can override the EWA Gaussian filter being used.
if you change the support, the Ellipse radius will change. Gaussian is using a support of 2.0 for its default sigma of 0.5.
As long as you do not effect the sigma, the blur input should not be effected.
(Err... Fingers crossed! Things always seem to give me trouble with variable blurs, but I believe I have it right!)
If that is the case, then what does the linear gradient do?
The size of the ellipse (actually the resample area and hence the sigma) is varied according to the 'map' the linear gradient makes the blur smaller to a hard limit EWA radius of 1 (sigma 0.25 minimum). In distorts this controlled the ellipse vectors using the 'derivative' of the distorts. You should know all about that.
As such 'red' channel maximum gives the sigma width the user supplied. 'green' maximum gives the height, and if (and only if) an two angles is given (as a range) 'blue' varies the angle of the ellipse, otherwise it is ignored.
The gradient thus linearly decreases the amount of blur from user maximum (white) to zero (actually a 0.25 sigma hard limit minimum) basically by changing the 'derivative vectors' used to define the resampling ellipse.
Would it not be better to have the map for width and height be a gaussian roll-off independent of the radius, which would be the width and height arguments, so that one could control the sigma independent of the radius. Then a linear gradient would be like having a very large sigma (as in -blur) and and a user supplied radius. Then this would really be like a true camera motion blur (i.e. a 1D version of -blur radiusx65000) at an arbitrary direction.
That map controls the variable blur, the map does not control the filter function! That is just a gaussian fixed by the filter support.
If you like a linear roll off filter try using
-define filter:filter=Box -define filter:support=0.5
The radius will be exactly as you give as the arguments to the compose (Gaussian sigma is 0.5, and Box support is 0.5)
You are lucky I have not restricted expert options, only the
-filter option is not used, and which the expert options can override!
Does zero for width or height mean then that the ellipse is 1 pixel thick in the minor axis direction?
The Ellipse axises is clamped to a minimum of 1.0, so as to ensure the ellipse can actually find pixels to sample in the filters suport range. With Gaussian the filter support is 2.0 so when this gets clamped to 1.0 minimum sigma is 0.25
You can use a height of 0 if you like, it will get clamped to the minimum.
I will experiment with it tomorrow, to see if I can get a better understanding of its limitations and functionality for doing what I would like.
Simple experiments with a white square on black background and a solarized gradient, do indeed show a gaussian roll-off that is symmetrical on both sides of the white square (using im_profile).
Would be nice if this were linear roll-off, but I can experiment with my scripting tests using this.
Try overriding the internals using Box as mentioned above.
Hmmm
Code: Select all
convert logo: \( +clone -fill white -colorize 100% \) \
-define filter:filter=Box -define filter:support=0.5 \
-define compose:args="20x0-30" -compose Blur -composite show:
Well it looks like a linear blur to me! Though it is abusing the intended design of the operation!
The Ellipse is producing a few artifacts as the support radius is rather 'hard' without any tapering effect.