Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

WebP fallback image

1,190 sites Security covered
View on drupal.org

This module allows you to automatically convert images to the WebP format for modern browsers and generate fallback JPG versions when needed. It integrates with Drupal's image styles to ensure optimal quality and efficient file sizes.

Use Drupal core's webp support to set up conversion in image styles. This way prepare the best quality images for modern web browsers. This module will prepare a fallback jpg image from the stylized webp to be used by fewer browsers: https://caniuse.com/webp. The module does not generate unnecessary jpg images, they are generated only when specifically requested.

Installation

  • Install and enable this module.
  • Enable responsive image module.
  • In image styles add effect Convert and Convert to WEBP.
  • Create each image style responsive image style.
  • Use responsive image style in entities display settings for images.

Dependencies

Responsive Image (core module)

Similar modules

Rationale

While similar modules provide solutions for generating the fallback jpeg images for webp, we found that they are doing this in a sub-optimal way.
The primary problem is that they don't create the webp derivative directly from the source file, but they are first creating a jpeg (or sometimes png or gif according to the original file's format) and then converting it to a webp. As the image styles are in most cases downscaled and the jpeg lossy compression is applied, the potential quality and/or size benefits of moving to the webp format this way essentially are wasted.
Another issue, a performance-related one we've seen in similar modules is that they are creating the jpeg and the webp derivatives at the same, single request. We believe that a request for a webp image should not generate a jpeg - maybe that jpeg will never be used! Our module will generate the jpeg images only when they are requested - it might also create 2 images in the same request, when the request goes for a jpeg but the webp does not exist yet, but this is a very unlikely case.
More background: https://www.brainsum.com/blog/webp-right-way-and-wrong-way-drupal

Activity

Total releases
1
First release
Apr 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
1.2.6 Stable Apr 25, 2025