PHP code example of blue-tomato / image-blurhash

1. Go to this page and download the library: Download blue-tomato/image-blurhash library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

blue-tomato / image-blurhash example snippets


$page->image_field->blurhash

$page->image_field->getBlurhashDataUri(float $width, float $height)

<img src="$page->image_field->getBlurhashDataUri(500, 300)" alt="" data-lazy="$page->image_field->size(500, 300)" />
bash 
php regenerateImages.php
bash
php generateEmptyImages.php