Drupal is a registered trademark of Dries Buytaert

vips

No security coverage
View on drupal.org

Provides libvips as a fast, memory-efficient image processing toolkit for Drupal. An alternative to GD and ImageMagick, typically 4× faster and using 10× less memory for common image operations. Requires only Drupal core — no contrib dependencies.

Features

  • Fast spatial operations — resize, crop, and rotate are 3–50× faster than ImageMagick for large source images, thanks to libvips’s shrink-on-load pipeline which never materialises the full pixel buffer.
  • Low memory footprint — 2–4× less peak RAM than ImageMagick for operations requiring the full decoded image. Lower per-request memory means more concurrent image style generations before PHP-FPM workers become the bottleneck.
  • Streaming format conversion — converting JPEG to WebP reads and encodes in strips without holding the full image in memory.
  • AVIF read/write support — requires the libheif AOM encoder system plugin for writing.
  • Configurable JPEG quality — single setting, default 75.
  • No contrib dependencies — integrates with Drupal core’s image toolkit plugin system only.

Strong fit — use libvips when:

  • Source images are large (DSLRs, high-res uploads). libvips uses JPEG shrink-on-load: it instructs the decoder to work at a reduced scale so the full pixel buffer is never materialised. At 8000×5333 it is 3× faster than GD for thumbnailing and 50× faster than ImageMagick, which always decodes the full image first.
  • Memory is constrained. For operations that need the full image (rotate, format conversion) libvips uses 2–4× less peak RAM than ImageMagick and meaningfully less than GD.
  • Throughput matters more than any single request. The combination of speed and low memory means more concurrent derivatives can be generated without hitting memory limits or queuing.
  • You are generating many image styles. The gains compound: a site with 10 image styles on a 20 MP upload processes all 10 in the time ImageMagick needs for one.

Not a fit — prefer GD or ImageMagick when:

  • PHP FFI is unavailable (some shared hosts disable it). GD is always present.
  • You need operations not yet implemented in this module (watermarking, ICC profile conversion, advanced compositing). ImageMagick covers the widest feature set.
  • Colour accuracy is critical. libvips and GD use different interpolation and gamma handling. For most editorial images the difference is invisible; for scientific or print workflows, validate output carefully.

Performance

Benchmarked against an 8000×5333 JPEG source (~880 KB), 5 iterations per operation (PHP 8.4, DDEV/Docker). Full benchmark script available as a GitHub Gist.

Speed (ms, lower is better):

Operation GD ImageMagick libvips Resize to thumbnail (200×133) 90 ms 1407 ms 28 ms Scale and crop (800×600) 131 ms 288 ms 60 ms Rotate 90° 1067 ms 810 ms 387 ms Convert JPEG → WebP 3060 ms 3183 ms 3225 ms

Peak memory RSS (lower is better):

Operation GD ImageMagick libvips Resize to thumbnail n/a n/a n/a Scale and crop n/a n/a n/a Rotate 90° 400 MB 563 MB 153 MB Convert JPEG → WebP 473 MB 555 MB ~0 MB

libvips is fastest for all spatial operations. WebP conversion is I/O-bound at this scale — all three toolkits land within 5% of each other. Resize and crop use libvips’s shrink-on-load pipeline, which never materialises the full pixel buffer. The WebP memory result demonstrates libvips’s demand-driven streaming architecture: it reads and encodes in strips without ever holding the full image in memory.

Post-Installation

After enabling the module:

  1. Go to Administration → Configuration → Media → Image toolkit (admin/config/media/image-toolkit).
  2. Select libvips image manipulation toolkit and save.
  3. Optionally adjust the JPEG quality setting (0–100, default 75).

Check Administration → Reports → Status report (admin/reports/status) to confirm libvips is detected and all requirements are met. The status report will flag a missing libheif AOM encoder if AVIF write support is unavailable.

Additional Requirements

  • libvips system library ≥ 8.x — e.g. libvips42 on Debian/Ubuntu. See the official install guide for macOS (Homebrew), Windows, and other distributions.
  • PHP FFI extension — add extension=ffi and ffi.enable=true to php.ini and restart PHP-FPM.
  • jcupitt/vips PHP library ≥ 2.0 — install via composer require jcupitt/vips.
  • libheif AOM encoder plugin (e.g. libheif-plugin-aomenc on Debian/Ubuntu) — required for writing AVIF. All default Drupal image styles include an AVIF conversion step, so image style generation will fail without this package.

No additional modules are required or recommended. The module integrates directly with Drupal core’s image toolkit and image styles system.

Similar projects

  • GD (Drupal core built-in) — always available, no extra dependencies, suitable for small images. Slower for large source images and uses more memory for format conversion.
  • ImageMagick module — widest feature set (watermarking, ICC profiles, advanced compositing). Significantly slower and more memory-hungry for spatial operations on large images. Best choice when advanced features are needed.

libvips fills the gap between GD (lightweight, limited) and ImageMagick (full-featured, heavy): it covers all standard Drupal image style operations with the best performance and memory profile of the three.

Supporting this Module

Contributions, bug reports, and feature requests are welcome via the project issue queue.

Community Documentation

Activity

Total releases
2
First release
Feb 2026
Latest release
1 week ago
Release cadence
1 day
Stability
50% stable

Releases

Version Type Release date
1.0.0 Stable Feb 21, 2026
1.0.x-dev Dev Feb 20, 2026