LoginLogin About

Support » Knowledge Base » Photos »

Which is better: GD or Imagick?

GD and Imagick are two totally independent PHP extensions that are used for graphics editing.

Main image manipulation functions in WebAsyst Photos are based on the functionality provided by those extensions. For WebAsyst Photos to work correctly on a remote server (on a web hosting) at least one of the two extensions must be installed and enabled: either GD or Imagick. In WebAsyst Photos section "Settings" there is an option to choose which of them should be used for photos management.

We recommend using Imagick.

Both extensions are similar in the functionality, however, Imagick allows to achieve better results with all basic operations:

  • Creation of thumbnails from original photos: Imagick is faster by about 10% and generates images of higher quality (see an example below), memory usage rate with Imagick is also lower than in case of GD.
  • Applying the sharpening filter: Imagick performs this task several times faster than GD.
  • Rotation and cropping require thumbnails re-generation which is why Imagick still stays ahead of GD.

Sample thumbnails (pay attention to the rendering quality of small details on a thumbnail of 256 pixels size created by WebAsyst Photos using GD and Imagick extensions on the same server; sharpening filter was enabled in both cases):

 GDImagick

Note about GD:
Tests have revealed that GD utilizes more server memory when processing large images. So, for instance, with the memory_limit being set to 64 MB in PHP configuration the GD extension successfully generates thumbnails and applies the sharpening filter to photos of size under 6 Mpx (3008*2000 pixels). For 10 Mpx large photos this amount of memory is not sufficient.
If you have an even more strict memory limitation on your server (e.g., 32 МB), then most probably you would need to manually reduce the size of your photos before uploading them to WebAsyst Photos.
The Imagick extension requires less server memory, for example, with the 64 МB memory limit 10 Mpx large photos were processed with the memory limitation exceeded.

The experience shows that most web hosting servers only support the GD extension while Imagick is, as a rule, not supported. Nevertheless, we do recommend choosing a web hosting for WebAsyst Photos which supports the Imagick extension.

Online service WebAsyst Photos installed utilize Imagick for graphics processing.

GD and Imagick test script. In order to find out whether GD and Imagick are supported by your server and whether the sharpening filter is correctly applied to uploaded photos you can use our simple test script. Download it (64 KB), extract the archive into an empty server directory (e.g. image-test) and run it in a browser (e.g., at http://domain.com/image-test/index.php). This script will determine whether the GD and Imagick extensions are installed and enabled on your server and will attempt to apply the sharpening filter to a demo image.