WebP is a containerized graphics format that works with both lossy and lossless compression. Originally from On2 Technologies, it is now being developed by Google under the BSD license.
The format intends to be a new open standard for true-color graphics with lossy compression, and is therefore being presented as a direct competitor to JPEG, which expects to be outperformed in the production of smaller file sizes with comparable image quality.
WordPress 5.8+ supports the WebP image format.
With the launch of the Performance Lab plugin, WordPress is working intensively on optimization. In future versions, a series of messages related to the use of WebP as a format will be incorporated into the Site Health.
This means that, in case the server is not up-to-date, users can be alerted to contact their hosting provider to configure the server to support this format.
The WordPress Hosting Team wants to help set up the necessary elements for WebP to work and be ready, before these new messages are included natively in the WordPress core.
More information from the Core Team about enabling WebP by default.
PHP GD
The native support feature for WebP is available in several versions of PHP. For example, in PHP 5.4+, PHP 7+ and PHP 8+.
As of now, some of the functionalities that are included:
- Normal WebP (VP8): supported since PHP 5.4
- Transparent WebP or alpha transparency (VP8X, VP8L): supported since PHP 7.0
- Animated WebP (VP8X): not supported at all.
ImageMagick
ImageMagick with WebP support requires the WEBP delegate library. Specify the encoding options with the -define option See WebP Encoding Options for more details.
There are some precompiled packages:
- Ubuntu (18-20-21):
apt-get install libwebp-dev - Debian (9-10-11):
apt-get install libwebp-dev - CentOS 7:
yum install libwebp-devel - CentOS 8-9 / Almalinux 8:
dnf install libwebp-devel
About WebP format
Google, in its Web optimization project, has made available a WebP information portal.
Which web browsers natively support WebP?
Webmasters interested in improving site performance can easily create optimized WebP alternatives for their current images, and serve them on a targeted basis to browsers that support WebP.
- WebP lossy support
- Google Chrome (desktop) 17+
- Google Chrome for Android version 25+
- Microsoft Edge 18+
- Firefox 65+
- Opera 11.10+
- Native web browser, Android 4.0+ (ICS)
- WebP lossy, lossless & alpha support
- Google Chrome (desktop) 23+
- Google Chrome for Android version 25+
- Microsoft Edge 18+
- Firefox 65+
- Opera 12.10+
- Native web browser, Android 4.2+ (JB-MR1)
- Pale Moon 26+
- WebP Animation support
- Google Chrome (desktop and Android) 32+
- Microsoft Edge 18+
- Firefox 65+
- Opera 19+