Page 1 of 1

Imagemagick, Imagick and GD speed tests with php

Posted: 2010-08-03T13:22:55-07:00
by Bonzo
Over the last month or so I have been doing some speed tests and have put the results into a pdf ( 604kb ).

Some of you may be interested and I would like to read any comments you have.

http://www.rubblewebs.co.uk/imagemagick ... ests_1.pdf

Re: Imagemagick, Imagick and GD speed tests with php

Posted: 2010-08-06T11:31:21-07:00
by fmw42
With the help of user Bonzo, I also did some IM/PHP/Imagick timing comparisons. Each tests included 100 repeats to get an average time and each test was repeated 5 times and the results of the latter are shown in the following PDF table. The reason for the repeats was because the server could have occasional loads that cause spikes in the run times. Also the first run from the 100 repeats was generally longer time than others. Thus my feeling is to use the Min rather than the Average as a measure of the proper run time.

http://www.fmwconcepts.com/IM_PHP/IM_Timing_Tests2.pdf

I set up 4 different comparisons:

PHP exec script loop: this was a bash script loop of 100 repeats that was launched by PHP exec
PHP loop exec script: this was a bash script of one command that was looped 100 times in PHP
PHP loop exec cmd: this was a direct PHP/IM command that was run 100 repeats via exec
Imagick loop; this was an Imagick loop of 100 repeats

Note: the image computed by Imagick for the -distort barrelinverse (bulge test) did not look consistent with the other tests. I believe that Imagick has a bug in this command.

The image used for all the tests was the one created by the annotate test and is the following 935x113 image:

http://www.fmwconcepts.com/IM_PHP/testoutline1.png

Annotate:
convert -size 933x93 xc:white -fill skyblue \
-stroke black -strokewidth 1 -undercolor lightpink \
-font ./arial.ttf -pointsize 96 \
-gravity center -annotate 0x0+0+0 "THIS IS SOME TEXT" \
-trim -bordercolor white -border 10 +repage \
testoutline1.png

Arc:
convert testoutline1.png \
-virtual-pixel white \
-distort arc "180 0" \
-trim -bordercolor white -border 10 +repage \
testarc1.png

Bulge:
convert testoutline1.png \
-virtual-pixel white -gravity center \
-background white -extent 935x169 \
-distort barrelinverse "0 0 0 1 0 0 -0.1 1.1" \
-trim -bordercolor white -border 10 +repage \
testbulge1.png

Resize:
convert testoutline1.png \
-filter lanczos -resize 25% \
testresize1.png

Rotate:
convert testoutline1.png \
-background white -rotate 30 \
testrotate1.png

Wave:
convert testoutline1.png \
-background white -wave -56.5x935 \
-trim -bordercolor white -border 10 +repage \
testwave1.png

Wedge:
convert testoutline1.png -virtual-pixel white \
-distort perspective "0,0 0,0 935,0 935,28.25 935,113 935,84.75 0,113 0,113" \
-trim -bordercolor white -border 10 +repage \
testwedgeright1.png