performance problem when adding a shadow

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
dileso
Posts: 6
Joined: 2009-09-30T05:14:35-07:00
Authentication code: 8675309

performance problem when adding a shadow

Post 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
dileso
Posts: 6
Joined: 2009-09-30T05:14:35-07:00
Authentication code: 8675309

Re: performance problem when adding a shadow

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: performance problem when adding a shadow

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply