How to serve WebP images with a Drupal 8/Drupal 9 site

Requirements

PHP

php -i | grep 'WebP'
WebP Support => enabled

Drupal

Screenshot of the Modules overview where you can see the installed ImageAPI modules

Drupal Configuration

The Image Optimize configuration page should look similar to this one. Note that you might only see the “Local Binaries” Pipeline first (if you installed it)

Let’s create a new pipeline

Add optimization pipeline
fill in the name of your pipeline
Add new Processor, choose “WebP Deriver”

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sascha Eggenberger

Sascha Eggenberger. Senior Product Designer @GitLab. Drupal Core Maintainer. Drupal Design System, Claro, Gin. #OpenSource https://sascha.is/