This applies specifically to MAMP Pro, but should also be applicable to other local development setups.
ImageMagick does not install with WebP support enabled by default. In order to get this working, there are a few steps you have to take.
-
Install or recompile ImageMagick with support for WebP.
brew install imagemagick --with-webp
-
Make MAMP’s version of PHP available via the command line. In MAMP Pro, select PHP (under Languages) and check the "Make this version available on the command line" checkbox for the version of php that you are using.
-
Reinstall imagick for php (a native php extension for using the ImageMagick API). This ensures that php "sees" your newly installed version of ImageMagick.
pecl install imagick
PHP in MAMP Pro should now be pointing to the newly compiled version of ImageMagick!