How to Effortlessly Manage Responsive Images in Drupal

About the Author

Ahmad Estaitia

Associate Software Engineer

Ahmad Estaitia is an Associate Software Engineer at Vardot with experience in Drupal development, frontend theming, and building accessible, responsive web solutions. He works on digital platforms and content-driven applications, contributing to scalable implementations, UI components, and performance improvements across web projects.

FAQs

Drimage Improved (Dynamic Responsive Image Improved) is an open-source Drupal module, maintained by Vardot and integrated in Varbase, that handles responsive images without configuring image styles or the Responsive Image module. It generates the image size each device needs on the fly, based on the viewport and a pre-defined aspect ratio, then caches the result to keep server load low.

The traditional approach requires building and maintaining a separate image style for every breakpoint, often dozens on large sites, which is time-consuming and error-prone. Drimage Improved instead generates only the size a device needs on demand from an aspect ratio, so there are far fewer configurations to maintain, less disk used on pre-generated derivatives, and smaller files served to each visitor.

Yes. Drupal core has supported WebP through the GD image toolkit since Drupal 9.2, and it is enabled by default in core image styles from Drupal 10. Drupal core added AVIF support in version 11.2. Because of this, Drimage Improved can output optimized WebP and AVIF images through core without a separate conversion module, provided the server's PHP GD build includes that support.

Install it with Composer using composer require drupal/drimage_improved and enable the module. Configure its global settings at admin/config/media/drimage_improved, including device pixel ratio detection and modern-format output. Then, on the Manage display tab of your content type, choose Dynamic Responsive Image as the format for the image field and set the aspect ratio, lazy loading, and optional link.

Drimage Improved serves the smallest appropriate image for each device in a modern format, WebP or AVIF, which can be up to 34% and 50% smaller than JPEG respectively. Generating sizes on demand and caching them reduces data transfer, requests, and server storage, which lowers page load time. Faster image delivery improves Core Web Vitals, and search and answer engines favor fast experiences, which supports SEO.

Join the conversation +