Page 1 of 1

performance problem when adding a shadow

Posted: 2012-01-12T16:43:39-07:00
by dileso
Hallo
I have a performance problem with IM on centos 5.7


To create a polaroid effects I use (PHP)

Code: Select all

$convert = IMAGEMAGICK_PATH."convert "
    ."-size {$polaroidWidth}x{$polaroidHeight} xc:white -matte -depth 8 "
    ."\( +clone -background black -shadow {$shadowAlpha}x{$shadowSize}+{$shadowOffsetX}+{$shadowOffsetY} \) +swap -background none -composite "
    ."\( $image -resize '{$pictureWidth}!x{$pictureHeight}!' \) -geometry +{$polaroidBorder}+{$polaroidBorder} -composite " 
    ."-units PixelsPerInch -density {$resolution} $outputImage";
exec($convert);
To create one image (2 or 3 MB JPG Images as source) it more then a Min. to process the image.
convert -list resource
File Area Memory Map Disk Thread Time
-------------------------------------------------------------------------------
768 2.0904GB 7.7874GiB 15.575GiB unlimited 8 unlimited
convert --version
Version: ImageMagick 6.6.7-6 2011-02-07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
I read about a problem with the OpenMP so I uninstalled the rpm and installed from the source configured with --disable-openmp but it was no change.

When I tryed to install new RPM (ImageMagick-6.7.4-0.x86_64.rpm) it failed because of
error: Failed dependencies:
libHalf.so.4 is needed by ImageMagick-6.5.5-6.i386
libIex.so.4 is needed by ImageMagick-6.5.5-6.i386
libIlmImf.so.4 is needed by ImageMagick-6.5.5-6.i386
libImath.so.4 is needed by ImageMagick-6.5.5-6.i386
libcdt.so.4 is needed by ImageMagick-6.5.5-6.i386
libfftw3.so.3 is needed by ImageMagick-6.5.5-6.i386
libgraph.so.4 is needed by ImageMagick-6.5.5-6.i386
libgvc.so.5 is needed by ImageMagick-6.5.5-6.i386
What can I do to get more performance?

Thanks for your help
Dirk

Re: performance problem when adding a shadow

Posted: 2012-01-18T08:54:03-07:00
by dileso
Has nobody an idea???
I needvery urgent help.

Also If you have other ideas how to create faster the Image.
eg. with gimo and scripts ?? I think this is possible but is it faster?
or maybe import a background Polaroid from existing file and scale it.
Is ther esomething like 9 grid scaling in IM to not distortin the shadow of the polaroid?
Would it be faster?

Thanks
Dirk

Re: performance problem when adding a shadow

Posted: 2012-01-21T05:32:28-07:00
by anthony
The slowest part of a shadowing operation is large sized blurs.

However it is next to impossible to look at or experiment as you have a whole set of variables in yoru example without values. Just how big is your shadow blur, and other operations.

Also polaroid is itself a complex command, including rotates, waves, blurs, and annotations.