PHPackages                             fdmind/statamic-libvips - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. fdmind/statamic-libvips

ActiveLibrary[Image &amp; Media](/categories/media)

fdmind/statamic-libvips
=======================

Use libvips as the image manipulation driver for Statamic's Glide, alongside GD and Imagick.

v1.0.1(2d ago)08↑2525%proprietaryPHPPHP ^8.2

Since Jun 7Pushed 2d agoCompare

[ Source](https://github.com/4dmind/statamic-libvips)[ Packagist](https://packagist.org/packages/fdmind/statamic-libvips)[ RSS](/packages/fdmind-statamic-libvips/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Statamic Libvips
================

[](#statamic-libvips)

> Use [libvips](https://www.libvips.org/) as the image manipulation driver for Statamic's Glide, alongside the built-in GD and Imagick drivers.

libvips is dramatically faster and far more memory-efficient than GD or Imagick, especially for large images, thanks to its streaming, shrink-on-load pipeline. This addon lets you switch Statamic's image processing to libvips by changing a single config value.

Requirements
------------

[](#requirements)

- PHP 8.2+
- Statamic 5 or 6
- [libvips](https://www.libvips.org/install.html) installed on the server (8.13+ recommended; AVIF/HEIF support requires libvips built with libheif)
- A way for PHP to talk to libvips — **one** of:
    - the [`vips` PHP extension](https://github.com/libvips/php-vips-ext) (fastest), or
    - the `ffi` extension (bundled with PHP 7.4+), used automatically by `jcupitt/vips`

How to Install
--------------

[](#how-to-install)

```
composer require fdmind/statamic-libvips
```

Then make sure libvips is available on your server:

```
# macOS
brew install vips

# Debian / Ubuntu
apt-get install libvips42

# with AVIF/HEIF support you'll want a build that includes libheif
```

Verify PHP can reach it:

```
php -r "echo Jcupitt\Vips\Config::version();"   # prints e.g. 8.18.2
```

How to Use
----------

[](#how-to-use)

Set the image manipulation driver to `vips` in `config/statamic/assets.php`:

```
'image_manipulation' => [
    // ...
    'driver' => 'vips',
],
```

That's it. Every Glide manipulation — the `{{ glide }}` tag, the `glide`modifier, presets, Control Panel thumbnails and asset focal-point crops — now runs through libvips. No template changes are required.

> **Tip:** to switch drivers per-environment, make the value env-driven: `'driver' => env('STATAMIC_IMAGE_DRIVER', 'gd')`, then set `STATAMIC_IMAGE_DRIVER=vips` in production.

### Configuration (optional)

[](#configuration-optional)

Publish the config file to tune encoding behaviour:

```
php artisan vendor:publish --tag=statamic-libvips-config
```

```
// config/statamic-libvips.php
return [
    'quality'   => 90,     // default quality for lossy formats when "q" is absent
    'strip'     => true,   // strip EXIF/XMP metadata (ICC is converted to sRGB)
    'interlace' => true,   // progressive JPEG / interlaced PNG
    'linear'    => false,  // resize in linear light (more accurate, slower)
    'smart_crop'=> false,  // attention-based crop when fit=crop has no focal point
    'encoders'  => [ /* per-format libvips saver options */ ],
];
```

Supported Glide parameters
--------------------------

[](#supported-glide-parameters)

All standard Glide manipulation parameters are supported:

ParameterNotes`w`, `h`, `dpr`Width / height / device-pixel-ratio`fit``contain`, `max`, `fill`, `fill-max`, `stretch`, `crop`, `cover` — including positioned (`crop-top-left`…) and focal/zoom (`crop-25-75-2`) variants`crop`Explicit `w,h,x,y` coordinate crop`or``auto` (EXIF), `0`, `90`, `180`, `270``fm``jpg`, `pjpg`, `png`, `gif`, `webp`, `avif`, `tiff`, `bmp``q`Quality for lossy formats`bri`, `con`, `gam`Brightness / contrast / gamma`sharp`, `blur`, `pixel`Sharpen / blur / pixelate`filt``greyscale`, `sepia``flip``h`, `v`, `both``bg`Background colour (flattens transparency / fills padding)`border``width,color,method` (`overlay`, `expand`, `shrink`)`mark*`Watermark (`mark`, `markw`, `markh`, `markx`, `marky`, `markpad`, `markpos`, `markalpha`, `markfit`)### Notes &amp; differences

[](#notes--differences)

- Output is produced by libvips' own high-quality resamplers, so pixels won't be byte-identical to GD/Imagick, but parameter semantics match Glide.
- `bri`/`con`/`gam`/`sharp`/`blur` map libvips operations onto Glide's 0–100 ranges; results are visually equivalent rather than mathematically identical.
- Setting `smart_crop = true` uses libvips' attention-based cropping for `fit=crop`/`fit=cover` requests that don't specify a focal point or position.
- The cache memory of the long-running queue worker is kept in check by disabling libvips' operation cache.

Pre-generating presets in parallel
----------------------------------

[](#pre-generating-presets-in-parallel)

Statamic ships `php please statamic:assets:generate-presets`, but it processes images one at a time (or hands them to your queue). This addon adds a command that saturates every CPU core to warm your entire preset cache as fast as the server allows — ideal after a bulk import or a deploy.

```
php please assets:generate-presets-parallel
```

How it works:

1. It enumerates every image asset × every warm preset (the same set Statamic warms on upload, including CP thumbnails) into a **SQLite database** at `storage/statamic-libvips/presets.sqlite`.
2. It spawns a pool of worker processes (one per CPU core by default). Each worker atomically claims a batch of jobs from the database, generates them, and records the result. libvips runs single-threaded *per worker* so N workers fill N cores without oversubscription.
3. The database doubles as the progress + orchestration source, so the run is **resumable** and **crash-tolerant**: re-running continues where it left off, and jobs left in-flight by a crashed worker are automatically requeued.

### Options

[](#options)

OptionDescription`--workers=`Number of worker processes. Defaults to the CPU core count.`--batch=`Jobs each worker claims per iteration (default `5`).`--containers=`Comma-separated container handles to include (default: all).`--excluded-containers=`Comma-separated container handles to skip.`--presets=`Comma-separated preset names to include (default: all warm presets).`--fresh`Discard any existing run and rebuild the work list from scratch.`--retry-failed`Requeue jobs that failed on a previous run.`--force`Regenerate even if a cached image already exists.```
# Warm just two containers with 16 workers
php please assets:generate-presets-parallel --containers=articles,blog --workers=16

# Resume an interrupted run (default behaviour — just run it again)
php please assets:generate-presets-parallel

# Start over from scratch and re-encode everything
php please assets:generate-presets-parallel --fresh --force
```

Already-generated images are skipped automatically (Glide caches the result), so you usually don't need `--force` — only when source images or preset definitions have changed.

> Works with any Glide driver, but pairs especially well with the `vips` driver for maximum throughput. Requires `pdo_sqlite` (bundled with PHP).

Testing
-------

[](#testing)

```
composer test    # or: vendor/bin/phpunit
```

Tests that exercise libvips are skipped automatically when php-vips isn't installed.

License
-------

[](#license)

Proprietary — Copyright © 2026 4DMIND. All rights reserved.

You are free to download, install, and use this addon, including in commercial projects. Redistributing the addon itself (in whole or in part, modified or unmodified) as a standalone package or offering is not permitted. The software is provided "as is", without warranty, and 4DMIND accepts no liability for its use or any malfunction. See [LICENSE](LICENSE) for the full terms.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance99

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17e27884915af74b7ffd89e3cfe0c8300d1437cc260b409bf730a27d9bb49e45?d=identicon)[krzemo](/maintainers/krzemo)

---

Top Contributors

[![Krzemo](https://avatars.githubusercontent.com/u/1293123?v=4)](https://github.com/Krzemo "Krzemo (2 commits)")

---

Tags

image processingimagesglideaddonstatamiclibvipsvips

### Embed Badge

![Health badge](/badges/fdmind-statamic-libvips/health.svg)

```
[![Health](https://phpackages.com/badges/fdmind-statamic-libvips/health.svg)](https://phpackages.com/packages/fdmind-statamic-libvips)
```

###  Alternatives

[intervention/image-driver-vips

libvips driver for Intervention Image

47144.1k10](/packages/intervention-image-driver-vips)[rokka/imagine-vips

libvips adapter for imagine

43613.3k7](/packages/rokka-imagine-vips)[visuellverstehen/statamic-picturesque

A Statamic tag for building HTML-only responsive images.

1117.7k](/packages/visuellverstehen-statamic-picturesque)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23100.9k12](/packages/marcorieser-statamic-livewire)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

15131.5k](/packages/withcandour-aardvark-seo)[mia/statamic-image-renderer

113.2k](/packages/mia-statamic-image-renderer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
