Skip to content

Image Processing Engines

Media Optimisation supports two image processing engines: GD and Imagick. Each engine can be configured separately for resizing and format conversion operations, allowing you to optimize for your specific needs. While both engines work well, we recommend using Imagick when available due to its superior format support and image quality.

Engine Selection

The module allows you to choose different engines for different operations. You might use GD for resizing (faster) and Imagick for conversion (better format support). This flexibility lets you balance performance and compatibility based on your particular needs.

In most situations, the default configuration works excellently without modification. Only consider changing engine settings if you encounter specific performance or quality issues. The configuration options are there for fine-tuning when needed, but aren't required for normal operation.

GD Engine

GD is PHP's built-in image processing library. It's always available if PHP was compiled with image support (which is standard). GD is faster and uses less memory than Imagick but has more limited format support. Although the most common formats are supported.

GD Format Support

GD supports JPEG, PNG, and non-animated GIF by default. WebP support requires PHP 7.0+ with libwebp. AVIF support requires PHP 8.1+ compiled with libavif support, which isn't always available in standard distributions. It does not support animated WebP or AVIF.

To check your GD capabilities, run:

php -r "print_r(gd_info());"

Imagick Engine

Imagick provides PHP bindings for ImageMagick, offering more configuration options than GD and broader format support. It handles edge cases better (e.g. PNG color profiles) and provides more control over the conversion process.

Version Requirements

We recommend ImageMagick 7.0+ for best results, though 6.9+ works for most features. Specific format requirements include:

WebP Support: ImageMagick 6.9.0+ with libwebp. Animated WebP requires ImageMagick 7.0.10+ for full support.

AVIF Support: ImageMagick 7.0.25+ compiled with libheif and libaom. Note that AVIF with transparency requires ImageMagick 6.9.12-68 or later. The module will automatically skip AVIF conversion for transparent images on older versions.

Performance Tuning

Not all webshops are the same. A fashion brand with 200 products has different performance to quality considerations than a motor parts store with 1m+ products for their images.

If image conversion is too slow for your situation, consider the following configuration changes: - Use slightly more compression when resizing - Disable retina support - Disable converting animated images - Only select one optimized file format, e.g. only WebP - Select a different resampling method