Create Blurhash Strings during image upload
Modules that have a unique purpose not covered by existing categories.
Close to stable, but users are advised to be cautious and test thoroughly.*
|Date Added||June 9, 2020|
|Last Updated||June 18, 2020|
This module's files should be placed in /site/modules/ImageBlurhash/
How to install or uninstall modules
ImageBlurhash is a module for ProcessWire CMS which automatically generates Blurhash strings for uploaded images.
BlurHash is a compact representation of a placeholder for an image. E.g. used for lazy loading placeholders.
More about Blurhash itself:
- Execute the following command in the root directory of your ProcessWire installation:
composer require blue-tomato/image-blurhash
- ProcessWire will detect the module and list it in the backend's
ImageBlurhashsection. Navigate there and install it.
Activate Blurhash in the field setting of the image:
Generate Blurhash Strings
Return's the encoded Blurhash as string or false if not existing
$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)" />
Returns the decoded Blurhash as base64 PNG datauri for usage in an image. If not existing transparent GIF image will be returned.
Hint: If your image is 500x300 pixels, you can use 50x30 for the Blurhash Data-URI and and scale up the image with CSS. This makes Blurhash decoding faster, the data-uri smaller but the quality is still good.
For migration of existing fields there are two CLI script in the module directory
Generates for all image fields who have the createBlurhash option new Blurhashs.
Generates for all image fields who have the createBlurhash option and have no Blurhash in the database a new Blurhash.
Currently encoding component quality default to 4x3. In the future this value will be configurable over the field settings for each field.
Please open an issue for support.
Create a branch on your fork, add commits to your fork, and open a pull request from your fork to this repository.
To get better insights and onboard you on module implementation details just open a support issue. We'll get back to you asap.
Find all information about this module's license in the LICENCE.txt file.
- Admin Helpers
- Core Modules
- Development Tools
- Field Types
- Input Fields
- Language Modules
- Language Packs
- Markup Generation
- Premium Modules
- Process Modules
- Proof of Concept
- Site Profiles
- Social, Feeds, Services
- Text Formatters
- Other Modules
- Users and Access
*Use modules at your own risk. There are no guarantees or warranties. It is recommended that you backup your site and database before installing new modules.