WebP libraries for PHP
- GD ships with PHP and reads and writes still WebP images with
imagecreatefromwebpandimagewebp. It doesn’t read animated WebP. - Imagick uses ImageMagick: more libwebp options (lossless, method, alpha quality), animated WebP and conversion from many formats.
Intervention Image wraps both with a fluent API.
- GD PHP's bundled GD extension reads and writes WebP. How to convert JPEG or PNG to WebP, set WebP quality, write lossless WebP, keep transparency.
- Imagick Imagick is the PHP extension for ImageMagick. How to convert images to WebP, write lossless WebP with libwebp options, convert animated GIF to animated WebP.