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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Jossnaz
Posts: 3
Joined: 2015-02-07T15:37:41-07:00
Authentication code: 6789

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

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Jossnaz
Posts: 3
Joined: 2015-02-07T15:37:41-07:00
Authentication code: 6789

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

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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
snibgo's IM pages: im.snibgo.com
Jossnaz
Posts: 3
Joined: 2015-02-07T15:37:41-07:00
Authentication code: 6789

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

Post by Jossnaz »

thanks for the replies, that helped a lot!
Post Reply