Kore Nordmann - PHP / Projects / Politics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Author: Kore Nordmann :Date: Thu, 20 Dec 2007 17:32:54 +0100 :Revision: 5 :Copyright: CC by-sa ========================================== Comparison of PHP image libraries - Update ========================================== :Description: An update of my speed and quality comparison of PHP image libraries, this time including the iMagick2 package from pecl. I find this always a bit hard to phrase, because I am not only comparing libraries here, but also formats or extensions which are just used to create some graphic, which also may be used for something completely different (DOM). I am talking about general ways to create graphics with PHP here. In my article series I showed several ways on how to create images with PHP, going into implementation details etc. Now I just want to provide a very rough overview on speed and quality of the extensions. :: * kn::Graphic::Svg (250): 0.0363s (0.000145) * kn::Graphic::Cairo (250): 0.1328s (0.000531) * kn::Graphic::Flash (250): 0.1353s (0.000541) * kn::Graphic::GdWithoutSupersampling (250): 0.1660s (0.000664) * kn::Graphic::iMagick (250): 0.2822s (0.001129) * kn::Graphic::Gd (250): 0.3394s (0.001357) .. image:: bench_imagick.png :width: 150px :height: 150px :alt: iMagick output :align: right For this microbenchmark I disabled stuff like the border size reduction, which would cost some additional time for SVG and Flash generation, but I am not really sure if you would always need that. As you can see, and I expected, iMagick__ is not that fast, when it comes to image generation. The focus of the library is image manipulation and composition of images. The quality of the image is quite good, far better then the GD stuff, but it also does not really support gradients in shapes yet. See `this forum entry`__ for details. __ http://pecl.php.net/package/imagick __ http://imagemagick.org/discourse-server/viewtopic.php?f=6&t=8943 And here is a small graphical overview of the benchmark, looking nicer then the plain numbers: .. image:: image_benchmark.png :alt: PHP image library benchmark :align: center Remember, that the values on the Y axis are in milliseconds. The values are the average time for one run, when I run the image creation script with all the libraries each 250 times. The benchmark code is the same, like `in the last posting`__ - I just added a wrapper for iMagick and run all the stuff again. __ comparision_of_php_image_libraries.html If you want to learn more about iMagick, you should definitely check out `Mikko's blog`__, where he regularly shows interesting examples for the new iMagick API, which also really proofed helpful while developing the new backend. __ http://valokuva.org/ Btw, the graph has been rendered with `graph component`__ from the `eZ Components`__, with the cairo output driver, I just added to SVN, which will be available in the next major release, or in trunk__ from now on. __ http://ezcomponents.org/docs/tutorials/Graph __ http://ezcomponents.org/ __ http://svn.ez.no/svn/ezcomponents/trunk/ Trackbacks ========== - New features in eZ Components Graph 1.3 on Sun, 24 May 2009 12:57:38 +0200 in Kore Nordmann - PHP / Projects / Politics There are some interesting new features in the driver part of the graph component of the eZ components - one thing I even thought is "impossible" until some external submission... Comments ======== - Christian Otto at Fri, 29 Feb 2008 12:49:29 +0100 Hi, would you mind releasing the sourcecode, of this graph? Looks pretty, and would be an great example! Greetings, Christian - Kore at Fri, 07 Mar 2008 15:32:48 +0100 Sorry, I don't have the source anymore. But you may ask me during the next UG meeting, and I will recreate the chart for you. - Raul at Tue, 28 Oct 2008 16:00:35 +0100 Did you find the source code? - Fer at Thu, 30 Oct 2008 21:13:48 +0100 Hi! How do you do the coloured border line of the "polygons" Regards, Fer