Imagemagick, Imagick and GD speed tests with php

Announcements pertaining to ImageMagick, or ImageMagick related software. This list is moderated. No discussions here, instead post to the users group instead.
Post Reply
Posts: 2844
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Imagemagick, Imagick and GD speed tests with php

Post by Bonzo » 2010-08-03T13:22:55-07:00

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. ... ests_1.pdf
Last edited by Bonzo on 2010-08-07T00:46:18-07:00, edited 1 time in total.

User avatar
Posts: 22079
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Imagemagick, Imagick and GD speed tests with php

Post by fmw42 » 2010-08-06T11:31:21-07:00

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.

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:

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 \

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

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 \

convert testoutline1.png \
-filter lanczos -resize 25% \

convert testoutline1.png \
-background white -rotate 30 \

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

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 \

Post Reply