ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

As a PHP extension ImageMagick has less memory consumption compares to GD, which is the default graphic use in PHP.

Installing ImageMagick

  1. Download ImageMagick software from ImageMagick website, when I wrote this tutorial it’s ImageMagick-7.0.2-0-Q16-x64-dll.exe.
  2. Safe install (less problematic path) it to C:\ImageMagick, remember to check install path to Windows environments.
  3. Now download PHP ImageMagick extension from PHP PECL website, I’m using the 5.6 Thread Safe (TS) x86 .
  4. Now, open the zip file and extract php_imagick.dll to your PHP extension directory.
  5. From the same zip file extract all files start with CORE_RL_* to your Apache\bin directory.
  6. Open your php.ini file, which is usually at your PHP directory, and add ImageMagick extension: extension=php_imagick.dll to the list of extensions.
  7. Restart Apache, and checkout phpinfo(), if you’re succeed it’s listed there:
    imagick-php
Iklan