---
title: "Improving Site Performance with ImageMagick Drupal Module and WebP"
description: "Who says you can’t have your cake and eat it too? With Drupal’s ImageMagick module and WebP implementation, you can have high quality images and a fast performing website too! Learn how."
url: https://www.specbee.com/blogs/improving-site-performance-imagemagick-drupal-module-and-webp
type: Article
author: "Manish Saharan"
categories: "Drupal Talk"
published: 2021-11-02
updated: 2026-10-07
---

# Improving Site Performance with ImageMagick Drupal Module and WebP

It's not uncommon to believe that if you need a high quality image, it has to be large - you cannot compromise on its size. But this isn’t always true. Drupal’s very own ImageMagick module not only integrates with the fantastic ImageMagick tool that can help you create, compose or edit digital images but also lets you convert images to reduce size without jeopardizing their quality.

The plain truth is, you can't have an interactive and engaging website without including high quality digital images. However, many organizations run into problems because quality images usually add a lot of file size, which can lead to a slow performing website. But with tools like ImageMagick and image formats like WebP that can be leveraged in Drupal, you can get a faster and better performing (not to mention great looking) website. In this article you will learn about using the ImageMagick Drupal module, WebP image format and how you can implement them in your [Drupal 8/9 website](https://www.specbee.com/services/drupal-web-development).

 ![Drupal Imagemagick Module](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Drupal_Imagemagick_0.png.avif?itok=g55lPCZ-)

 

 ## What is the ImageMagick Drupal Module

[ImageMagick](https://www.drupal.org/project/imagemagick) is an image toolkit for image API in Drupal 7, 8 and 9. It uses [Imagick PHP Extension](https://www.php.net/manual/en/book.imagick.php) to create and edit images using the Imagemagick API. With ImageMagick, you can compress the image sizes with better quality. Using ImageMagick you can customize the quality of images from 0 to 100. A higher value means better image quality but bigger files. The [Drupal module](https://www.specbee.com/blogs/top-drupal-9-modules-for-your-drupal-project) supports both ImageMagick and GraphicsMagick image processing systems.

### Why use ImageMagick

- Page Optimization
- Faster website speed
- Helps increase the number of pages Google can crawl and index
- Reduce server load
- The faster your site loads, the lower the bounce rate

 ![Imagemagick Toolkit](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Imagemagick_toolkit_0.png.avif?itok=lcWrQcta)

 

 *ImageMagick Toolkit*

 ![Imagemagick supported format](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Supported_image_format_0.png.avif?itok=dT3pSGrH)

 

 *ImageMagick supports multiple image formats which can be enabled and disabled as required*

## Installing the ImageMagick Module

Before installing the ImageMagick Drupal module, make sure you have installed [ImageMagick](http://www.imagemagick.org/) on your server and the **convert** binary needs to be accessible and executable with php.

### Configuration

Navigate to **Administration > Configuration > Media > Image Toolkit** and change the Image toolkit to ImageMagick.

If you are not able to find **convert** binary command in the default shell path then you need to enter the full path of ImageMagick’s **convert** executable.

**For example:**

 ![Version Information](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Version_information_0.png.avif?itok=djG7cAnw)

 

 ## How to install ImageMagick on your server

- Install ImageMagick using [homebrew](https://formulae.brew.sh/formula/imagemagick).
- Or based on your operating system you can download it from [here](https://imagemagick.org/script/download.php).
- On successful installation, your php output should look like this (see below image):

 ![Imagick](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Imagick_0.png.avif?itok=2lFpRM8F)

 

 ## What is WebP

WebP is an image format employing both lossy and lossless compression. In a lossless compression, the file size is reduced but not the quality of the image. A lossless compressed image can also be decompressed to its original size. But a lossy compression removes data for good, which means you cannot decompress it back.

WebP is designed to create files that are smaller for the same quality, or of higher quality for the same size, than JPEG, PNG, and GIF formats. It also supports animation and alpha transparency.

## Implementing WebP with ImageMagick

**Step 1:** Enable WebP formats from Image Toolkit format options, which was explained previously.

**Step 2:** Now, create a new image style or update any old one with a convert effect. For example:

 ![Edit thumbnail style](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Edit_thumbnail_0.png.avif?itok=stG178oc)

 

  ![Webp](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Webp_0.png.avif?itok=9ShvUTPU)

 

 **Step 3:** After adding the convert effect, use the same image style to display images and you will see the result.

Let’s take an example of an image with size 1.2 MB (see below image):

 ![Convert Image](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Convert_image_0.jpg.avif?itok=vWhcnqQo)

 

 Now check out the results after converting the image:

 ![Reduced file size](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Reduced_file_size_0.png.avif?itok=WvvqghFH)

 

 You can see that the file size is now reduced to 8.6 KB from 1.2 MB, which is a very good reduction.

Using tools like ImageMagick and image formats like WebP, you can be assured that your Drupal website will still perform well with great quality images. ImageMagick does a great job at creating, editing and modifying images while also optimizing them for a faster web. If you found this article interesting, don’t forget to [subscribe to our weekly newsletter](https://specbee.us19.list-manage.com/subscribe?u=a3d560a1fc06522ef6c707339&id=689c8b7694) that gets delivered right into your inbox. Have a Drupal project in mind? We’d love to help you out. [Talk to us](https://www.specbee.com/contact) today.