PHPackages                             innoweb/silverstripe-image-placeholders - 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. innoweb/silverstripe-image-placeholders

ActiveSilverstripe-vendormodule[Image &amp; Media](/categories/media)

innoweb/silverstripe-image-placeholders
=======================================

Provides low quality, greyscale and data64 conversions for Image placeholders

4.0.0(8mo ago)12061BSD-3-ClausePHP

Since May 10Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/innowebau/silverstripe-image-placeholders)[ Packagist](https://packagist.org/packages/innoweb/silverstripe-image-placeholders)[ Docs](https://github.com/innowebau/silverstripe-image-placeholders)[ RSS](/packages/innoweb-silverstripe-image-placeholders/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (20)Used By (0)

Silverstripe Image Placeholders
===============================

[](#silverstripe-image-placeholders)

Overview
--------

[](#overview)

This modules provides:

- LQIP (low quality image placeholder)
- GIP (greyscale image placeholder)
- DCIP (dominant color image placeholder)
- DataURL (base64 encoded image data)

It also contains a method for [LCP LQIP described by Harry Roberts](https://csswizardry.com/2023/09/the-ultimate-lqip-lcp-technique/)which lets you use a LQIP so that it counts as the LCP image and the hi-res image gets swapped in later on. Thanks Harry for this wizardry ;)

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

[](#requirements)

- Silverstripe Assets ^3 (Silverstripe ^6)
- ksubileau/color-thief-php ^2

Installation
------------

[](#installation)

Install the module using composer:

```
composer require innoweb/silverstripe-image-placeholders dev-master

```

Then run dev/build.

Usage
-----

[](#usage)

Important

Make sure that any resizing is done prior to generating the placeholder image.

Do: ``

Don't: ``

LQIP, GIP and DCIP are smaller versions of the original image. Always write your own image tags with `width` and `height` attributes to make sure the image gets rendered correctly.

### Lazy loading via Javascript

[](#lazy-loading-via-javascript)

You can use these placeholders for images that are lazy loaded via Javascript, e.g.:

```

```

And then use [lazysizes](https://github.com/aFarkas/lazysizes) to load the images.

This uses the Base64 encoded data URL of the LQIP as a placeholder and then lazy loads the hi-res image.

### Native lazy loading

[](#native-lazy-loading)

You can also use these placeholders for images that are lazy loaded natively:

```

```

This uses the Base64 encoded data URL of the LQIP as a background of the image that is displayed while the actual image is loaded.

### Placeholder for LCP image

[](#placeholder-for-lcp-image)

Harry Roberts describes in a [blog post](https://csswizardry.com/2023/09/the-ultimate-lqip-lcp-technique/)how a LQIP can be set so that it counts as the LCP image and the hi-res image gets swapped in later on.

This module supports this behaviour with the `LCPLQIP` method.

You can set the bits per pixel (BPP) threshold described by [Google](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/speed/metrics_changelog/2023_04_lcp.md)using the following setting:

```
Innoweb\ImagePlaceholders\ImageExtension:
  min_bits_per_pixel: 0.055

```

Per default this is set to 0.055, which gives the value defined by Google another 10% to be on the safe side.

To use the LCP LQIP image, preload the LQIP image and set it as background for the actual image:

```

  ...

  ...

  ...

  ...

```

This way, the LQIP image is already loaded when the page is rendered and the hi-res image is then downloaded and swapped in. (The CSS background colour is used as another fallback, in case the LQIP is not available yet.)

Because the `LCPLQIP` image is over the BPP threshold and the hi-res image has the same dimensions as the `LCPLQIP` image, the `LCPLQIP` image is counted as the LCP image instead of the hi-res image.

Examples
--------

[](#examples)

Here are some examples of the code and the resulting images:

```
orig:$Image.Quality(80).Fill(300,200)
GIP:
LQIP:
DCIP:
LCPLQIP:$Image.Fill(300,200).LCPLQIP
DataURL:
```

[![Example](docs/placeholder-examples.jpg)](docs/placeholder-examples.jpg)

License
-------

[](#license)

BSD 3-Clause License, see [License](license.md)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance62

Regular maintenance activity

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% 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 ~68 days

Recently: every ~132 days

Total

19

Last Release

242d ago

Major Versions

1.1.1 → 2.1.12023-11-06

1.1.3 → 2.1.32023-11-07

1.x-dev → 2.1.42024-01-17

2.1.5 → 3.0.02024-04-15

3.x-dev → 4.0.02025-09-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d2e71d7787401a7bd4916062346163897f89f455d650ab32b5d60cd14825ad3?d=identicon)[xini](/maintainers/xini)

---

Top Contributors

[![xini](https://avatars.githubusercontent.com/u/1152403?v=4)](https://github.com/xini "xini (16 commits)")[![dizzystuff](https://avatars.githubusercontent.com/u/576903?v=4)](https://github.com/dizzystuff "dizzystuff (1 commits)")

---

Tags

performancesilverstripeimagesassetsoptimisationplacholder

### Embed Badge

![Health badge](/badges/innoweb-silverstripe-image-placeholders/health.svg)

```
[![Health](https://phpackages.com/badges/innoweb-silverstripe-image-placeholders/health.svg)](https://phpackages.com/packages/innoweb-silverstripe-image-placeholders)
```

###  Alternatives

[wp-media/imagify-plugin

Image optimization plugin for WordPress by WP Media.

7960.9k](/packages/wp-media-imagify-plugin)[moc/imageoptimizer

Flow package that optimizes generated thumbnail images (jpg, png, gif, svg) for web presentation.

31106.8k](/packages/moc-imageoptimizer)[christophlehmann/imgproxy

TYPO3 Extension for serving images with imgproxy.

1543.1k](/packages/christophlehmann-imgproxy)

PHPackages © 2026

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