Using WebP Images in Drupal to Reduce File Size and Improve Performance
Mario Hernandez shared a blog post focusing on WebP and its integration into Drupal. As someone deeply invested in responsive image handling, Mario explains how WebP—a format developed by Google—offers better compression and quality than JPEG and PNG. Since 2020, WebP has gained support across all major browsers, making it a practical choice for performance-conscious developers.
Mario outlines how Drupal supports WebP natively from version 9.2.0 onward, eliminating the need for custom code or contributed modules. Updating image styles in Drupal to include a Convert effect and selecting WebP as the target format is all it takes. A test on a Drupal 10 site demonstrated that converting a JPEG image (289kb) to WebP reduced its size to 76kb—showing the potential for significant file size savings with minimal effort.
While WebP is his focus, Mario also mentions Avif as a promising format worth exploring, depending on project needs and browser support. He concludes that adopting modern image formats is a small but impactful step toward faster-loading, more efficient websites, especially when working within a CMS like Drupal.