fmw42 wrote:I believe that if you use radiusxsigma=0xsigma, then the effective radius will be about 3xsigma. See
http://www.imagemagick.org/script/comma ... s.php#blur
"As a guideline, set r to approximately 3σ. If a radius of 0 is specified, ImageMagick selects a suitable radius for you."
As a FYI, if radius is defined the kernel width is set to 2*ceil(radius)+1
If sigma very very small, width is set to 1 (usually no effect on result)
Otherwise the width calculated to be at least 5 (radius 3), which is then increased until overall sum of the bell curve (its weighted average) falls below numerical accuracy from the previous one. That is the weighted_average_sum*QuantumRange is less than 1.
In other words a Q8 ImageMagick (QuantumRange=255) will have a smaller blur kernel size than a Q16 version (QuantumRange=65355), as it does not have the precision needed for a Q16 kernel size. Of course Q16 kernel is also much smaller than a Q32 or Q64. HDRI does not effect this result as it is the Q level, used for output limits, that define this precision.
Not this is NOT linear, and could be larger than sigma*3. It is not only different for different IM, Q levels, but also different for a 1D kernel (as in -blur) verses a 2D kernel (as in -gaussian).
As an experiment I recompiled my IM with an added print statement for the final kernel 'width' that Im decided to use, in my Q16 IM
-blur 0x100 needed a 1D kernel size of 667 (radius = 333)
-gaussian 0x100 needed a 2D kernel size 667 as well!!! Even though they are different functions.
Remember while while doubling sigma effectivally doubles the width of the gaussian bell curve, the precise cut of may not be quite so linear. But in all my experiments the width always seems to be the same for 1D or 2D curves even though the functions are slightly different, Hmmm their seems to be a bug in the 2D version
Blur Sigma => radius IM decided on (minimum = radius 3)
1 => 4
2 => 8
3 => 12
5 => 20
10 => 34
20 => 75
50 => 176
100 => 333
1000 => 2558
10000 => 14885
For IM Q16 that is roughly ceil(sigma*3.33) for reasonable sigma's (less than 100)