---
title: "Placeholders (LQIP) — Media Library for Laravel | Roundly"
description: "ThumbHash and Blurhash blur-up placeholders, plus recorded pixel dimensions, computed on add."
url: https://roundly-consulting.com/open-source/docs/media-library-for-laravel/placeholders
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Media Library for Laravel](https://roundly-consulting.com/open-source/docs/media-library-for-laravel.md)

# Placeholders (LQIP)

On add, the package records pixel dimensions and, for raster images, computes two low-quality image placeholders from a downscaled copy: a ThumbHash and a Blurhash. Both encoders and decoders are pure PHP with no third-party dependency and match the reference implementations on their reference vectors — a decoded ThumbHash keeps the encoded aspect ratio. SVGs and images over media.max\_image\_pixels get none:

```php
$media->width;                 // e.g. 1920 (null for non-images)
$media->height;                // e.g. 1080

$media->placeholder();         // ['thumbhash' => '1QcSHQ…', 'blurhash' => 'LPDI|4…']
$media->thumbhash();           // string|null
$media->blurhash();            // string|null
$media->placeholderDataUri();  // 'data:image/png;base64,…' — a tiny blur-up image
```

placeholderDataUri() decodes a placeholder server-side (ThumbHash preferred, Blurhash fallback) into a tiny PNG data: URI you can use as a blur-up background while the full image loads. GD or Imagick draws it — either is enough; with neither loaded it returns null and responsiveImage() renders its <img> without the blur-up background. Each placeholder type is independently toggleable in config.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/media-library-for-laravel.md)
