Page 1 of 1

Blurring 2.5 MB png files taking minutes, very slow on windows 8.1 with version 6.7.7

Posted: 2015-02-07T15:45:33-07:00
by Jossnaz
Hi

I am using imagick together with php

I perform the following blur:

Code: Select all

        $img = new Imagick$filename);
        $img->gaussianblurimage(30, 30);
        file_put_contents ("30".$filename , $img);
        $img->gaussianblurimage(50, 30);
        file_put_contents ("50".$filename, $img);
        $img->gaussianblurimage(80, 30);
        file_put_contents ("80".$filename, $img);
This takes several minutes to perform and CPU rises to 75%.

I run it on windows
version:
C:\Users\Lukas>convert -version
Version: ImageMagick 6.7.7-4 2012-05-29 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

Re: Blurring 2.5 MB png files taking minutes, very slow on windows 8.1 with version 6.7.7

Posted: 2015-02-07T15:59:42-07:00
by snibgo
"-blur" is much faster than "-gaussian-blur" and gives almost identical results, for most purposes.

The numbers 30,50 etc -- are they radius and sigma? For large radii, resizing the image down then up can give good results, and is very much faster.

Re: Blurring 2.5 MB png files taking minutes, very slow on windows 8.1 with version 6.7.7

Posted: 2015-02-07T16:07:10-07:00
by Jossnaz
Thanks for the reply
yes, the first number is the radius, the second the sigma.


just curious. Does it take for you minutes as well to blur a 1920x1200 image?

or at least several seconds?

Re: Blurring 2.5 MB png files taking minutes, very slow on windows 8.1 with version 6.7.7

Posted: 2015-02-07T16:28:40-07:00
by fmw42
For large blurs (0xlargesigma), you can resize the image down, blur with a proportionally smaller sigma, then resize it back up. It will be much faster. See my examples at http://www.fmwconcepts.com/imagemagick/ ... fast_gblur

I do not suggest you use both radius and sigma. Typically IM will figure out the right radius, if it is set to 0, given the sigma, i.e. 0xsigma

Re: Blurring 2.5 MB png files taking minutes, very slow on windows 8.1 with version 6.7.7

Posted: 2015-02-07T16:30:38-07:00
by snibgo
At the command line, for a 1920x1200 image, "-gaussian-blur 50x30" takes about 18 seconds. "-blur 50x30" takes about zero seconds.

IM v6.9.0-0 on Windows 8.1

Re: Blurring 2.5 MB png files taking minutes, very slow on windows 8.1 with version 6.7.7

Posted: 2015-02-07T16:38:04-07:00
by Jossnaz
thanks for the replies, that helped a lot!