This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Blogs » Philippe VINCENT-ROYOL » Alternativ to ImageMagick


Alternativ to ImageMagick

Wednesday 24 October 2012 2:21:56 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

GraphicsMagick is the swiss army knife of image processing. It provides a robust and efficient collection of tools and libraries which support reading, writing, and manipulating an image in over 88 major formats including important formats like DPX, GIF, JPEG, JPEG-2000, PNG, PDF, PNM, and TIFF.

Image processing is multi-threaded using OpenMP so that CPU-bound tasks scale linearly as processor cores are added. 

GraphicsMagick is originally derived from ImageMagick 5.5.2 as of November 2002 but has been completely independent of the ImageMagick project since then. 

Its time to install it and configure for eZ Publish ! Command line was for Debian 6 Squeeze, but you can easily "translate" to Redhat Os, Cent Os, Ubuntu etc.

Why Using GraphicsMagick ?

Better performances than ImageMagick. You could find some benchmark here : and here



You need to install gcc and some dev librairies. So to resume :

apt-get install gcc make libpng12-dev libjpeg62-dev libjasper-dev

This command line will install librairies for PNG, JPEG and JPEG2000 files. You could add more librairies, please check here :



Download GraphicsMagick's archive ( I downloaded version 1.3.17. (Installation via apt-get have some issues with convert parameters)

Extract archive and install :

tar xvfz GraphicsMagick-1.3.17.tar.gz
cd GraphicsMagick-1.3.17
make install

Configure eZ Publish 4.X

Just create an image.ini.append.php file and inject those lines:

Executable=gm convert

Purge cache and its works ! If not check debug file or add a test point (like a barbarian with a var_dump) on ./lib/ezimage/classes/ezimageshellhandler.php line 100

Full Filters example: (implement on settings/override/image.ini.append.php)

Executable=gm convert
Filters[]=vignette=-resize '%1x%2^' -gravity center -crop %1x%2+0+0 +repage
Filters[]=sharpen=-sharpen 0.5 

On this example, i would like to resize to fill a box (width: 682px; height: 224px). I add an option, strip, to remove comment an other useless information on image. Apply a resize, center image and use a crop. It works with ImageMagick and GraphicsMagick.

Configure eZ Publish 5.x

You need to modify your ezpublish.yml (located on <ez5_root>/ezpublish/config/ezpublish.yml) and add this:

    enabled: true
    path: /path/to/gm convert

Be careful: you need to apply this patch

Thanks to Jerome with his usefull advice :)



Extra Tips : Install on Mac OSX (Mountain) Lion

You need to download source file :

After that, uncompress each file and run those command lines

# download libpng 1.4.x (1.5 didn't work yet with GraphicsMagick 1.3.12)
./configure --prefix=/opt/local && make && make install

# download libjpeg
./configure --prefix=/opt/local && make && make install

# download GraphicsMagick
CFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ./configure --prefix=/opt/local --disable-openmp --disable-openmp-slow && make && make install

Don't forget it needed, to add /opt/local to your path. (Edit ~/.bash_profile) and add :

export PATH="/opt/local/bin:$PATH"

Save and reload bash profile via

source ~/.bash_profile
Proudly Developed with from