[magick-developers] ImageMagick's dithering

Sam Hocevar sam at zoy.org
Mon Aug 11 08:43:57 PDT 2008


On Sat, Aug 09, 2008, Anthony Thyssen wrote:

> | A few things are way too complex for me right now, though. For
> | instance, IM's Gaussian blur routine runs in O(n^2) instead of O(n),
> | making it painfully slow to blur images. Someone might want to have a
> | look at this.
> 
> You should not use -gaussian operator.  It is O(n), and implemented as a
> full convolution operation.

   I know. But when the rank of a NxN convolution matrix is 1 (which is
the case for Gaussian kernels) it can be factored into an Nx1 and an
1xN convolution. The running time is therefore O(2N) instead of O(N^2),
meaning a 100x100 blur becomes 50 times faster.

> The -blur operator is a two pass blur that is a lot faster and produces
> a practical equivelent result.  In most IM examples I use -blur instead
> of using -gaussian.

   I agree box blur is usually enough. I have my own reasons to use
Gaussian blur, so I was just pointing out it could be dramatically
improved.

Regards,
-- 
Sam.


More information about the Magick-developers mailing list