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?".
Jossnaz
Posts: 3 Joined: 2015-02-07T15:37:41-07:00
Authentication code: 6789
Post
by Jossnaz » 2015-02-07T15:45:33-07:00
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
Post
by snibgo » 2015-02-07T15:59:42-07:00
"-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.
Jossnaz
Posts: 3 Joined: 2015-02-07T15:37:41-07:00
Authentication code: 6789
Post
by Jossnaz » 2015-02-07T16:07:10-07:00
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?
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2015-02-07T16:28:40-07:00
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
Post
by snibgo » 2015-02-07T16:30:38-07:00
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
Jossnaz
Posts: 3 Joined: 2015-02-07T15:37:41-07:00
Authentication code: 6789
Post
by Jossnaz » 2015-02-07T16:38:04-07:00
thanks for the replies, that helped a lot!