iamriajul/thumbhash-laravel

A PHP implementation of Thumbhash with Laravel integration.
13,597 2
Install
composer require iamriajul/thumbhash-laravel
Latest Version:1.0.3
PHP:^8.1
Laravel:9 – 12
Older releases:8
License:MIT
Last Updated:Jun 3, 2025
Links: GitHub  ·  Packagist
Maintainer: iamriajul

Thumbhash

Testing Latest Stable Version Total Downloads License

A PHP implementation of Thumbhash with Laravel integration.

Thumbhash is a compact representation of a placeholder for an image.

screenshot

⚠️ I highly recommend to have Imagick extension installed on your computer. GD extension has only 7 bits of alpha channel resolution, and 127 is transparent, 0 opaque. While the library will still work, you may have different image between platforms. See on stackoverflow

Supported Laravel Version

9.0 ~ 12.x

Installation

Install using composer

composer require iamriajul/thumbhash-laravel

Publish config file (Optional for )

php artisan vendor:publish --provider="Riajul\Thumbhash\ThumbhashServiceProvider"

Set up config file on config/thumbhash.php

Done!

Usage

Facade

Thumbhash::encode($file);

$file can be any Intervention make method acceptable source.

app helper function

app('thumbhash')
  ->encode(request('file'));

TODO:

  • Support decoding from thumbhash base64 string.
  • Support encoding to thumbhash binary array.
  • Support decoding from thumbhash binary array.
  • Support encoding to dataURL.

License

Thumbhash is licensed under The MIT License (MIT).

Related Packages

daun/statamic-placeholders

Generate low-quality image placeholders for lazyloading Statamic assets

10,300 10
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

641,106,524 9,700
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

502,645,077 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

418,291,778 609

Version History

Version Released PHP Laravel License
1.0.3 ^8.1 ^9.0 || ^10.0 || ^11.0 || ^12.0 MIT
1.0.2 ^8.1 ^9.0 || ^10.0 || ^11.0 || ^12.0 MIT
1.0.1 ^8.1 ^9.0 || ^10.0 || ^11.0 MIT
1.0.0 ^8.0 ^8.0 || ^9.0 || ^10.0 MIT