Adds a readonly blurhash field to upload-enabled collections and fills it automatically when an image is uploaded. It is configured through the plugins array in the Payload config with a list of collection slugs. Works with Payload 1.7.2 or newer, with 2.0.0 or newer recommended. Generation for image sizes is not supported yet.
Dead simple BlurHash auto generation plugin for Payload CMS
Installation
npm i @zapal/payload-blurhash-plugin8
Stars
0
Forks
1
Open Issues
2 years ago
Last Updated
35
Weekly Downloads
v1.0.7
npm Version
43.0 KB
Unpacked Size
1
Dependencies
80 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 8 |
| Dec 4, 2026 | 8 |
| Dec 3, 2026 | 8 |
| Dec 2, 2026 | 8 |
| Dec 1, 2026 | 8 |
| Nov 30, 2026 | 8 |
| Nov 29, 2026 | 8 |
| Nov 28, 2026 | 8 |
| Nov 27, 2026 | 8 |
| Nov 26, 2026 | 8 |
| Nov 25, 2026 | 8 |
| Nov 24, 2026 | 8 |
| Nov 23, 2026 | 8 |
| Nov 22, 2026 | 8 |
| Nov 21, 2026 | 8 |
| Nov 20, 2026 | 8 |
| Nov 19, 2026 | 8 |
| Nov 18, 2026 | 8 |
| Nov 17, 2026 | 8 |
| Nov 16, 2026 | 8 |
| Nov 15, 2026 | 8 |
| Nov 14, 2026 | 8 |
| Nov 13, 2026 | 8 |
| Nov 12, 2026 | 8 |
| Nov 11, 2026 | 8 |
| Nov 10, 2026 | 8 |
| Nov 9, 2026 | 8 |
| Nov 8, 2026 | 8 |
| Nov 7, 2026 | 8 |
| Nov 6, 2026 | 8 |
| Nov 5, 2026 | 8 |
| Nov 4, 2026 | 8 |
| Nov 3, 2026 | 8 |
| Nov 2, 2026 | 8 |
| Nov 1, 2026 | 8 |
| Oct 31, 2026 | 8 |
| Oct 30, 2026 | 8 |
| Oct 29, 2026 | 8 |
| Oct 28, 2026 | 8 |
| Oct 27, 2026 | 8 |
| Oct 26, 2026 | 8 |
| Oct 25, 2026 | 8 |
| Oct 24, 2026 | 8 |
| Oct 23, 2026 | 8 |
| Oct 22, 2026 | 8 |
| Oct 21, 2026 | 8 |
| Oct 20, 2026 | 8 |
| Oct 19, 2026 | 8 |
| Oct 18, 2026 | 8 |
| Oct 17, 2026 | 8 |
| Oct 16, 2026 | 8 |
| Oct 15, 2026 | 8 |
| Oct 14, 2026 | 8 |
| Oct 13, 2026 | 8 |
| Oct 12, 2026 | 8 |
| Oct 11, 2026 | 8 |
| Oct 10, 2026 | 8 |
| Oct 9, 2026 | 8 |
| Oct 8, 2026 | 8 |
| Oct 7, 2026 | 8 |
| Oct 6, 2026 | 8 |
| Oct 5, 2026 | 8 |
| Oct 4, 2026 | 8 |
| Oct 3, 2026 | 8 |
| Oct 2, 2026 | 8 |
| Oct 1, 2026 | 8 |
| Sep 30, 2026 | 8 |
| Sep 29, 2026 | 8 |
| Sep 28, 2026 | 8 |
| Sep 27, 2026 | 8 |
| Sep 26, 2026 | 8 |
| Sep 25, 2026 | 8 |
| Sep 24, 2026 | 8 |
| Sep 23, 2026 | 8 |
| Sep 22, 2026 | 8 |
| Sep 21, 2026 | 8 |
| Sep 20, 2026 | 8 |
| Sep 19, 2026 | 8 |
| Sep 18, 2026 | 8 |
| Sep 17, 2026 | 8 |
| Sep 16, 2026 | 8 |
| Sep 15, 2026 | 8 |
| Sep 14, 2026 | 8 |
| Sep 13, 2026 | 8 |
| Sep 12, 2026 | 8 |
| Sep 11, 2026 | 8 |
| Sep 10, 2026 | 8 |
| Sep 9, 2026 | 8 |
| Sep 8, 2026 | 8 |
| Sep 7, 2026 | 8 |
| Sep 6, 2026 | 8 |
41+25 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 41 |
| Dec 4, 2026 | 25 |
| Dec 3, 2026 | 25 |
| Dec 2, 2026 | 25 |
| Dec 1, 2026 | 27 |
| Nov 30, 2026 | 27 |
| Nov 29, 2026 | 20 |
| Nov 28, 2026 | 15 |
| Nov 27, 2026 | 14 |
| Nov 26, 2026 | 15 |
| Nov 25, 2026 | 15 |
| Nov 24, 2026 | 13 |
| Nov 23, 2026 | 13 |
| Nov 22, 2026 | 7 |
| Nov 21, 2026 | 15 |
| Nov 20, 2026 | 15 |
| Nov 19, 2026 | 15 |
| Nov 18, 2026 | 23 |
| Nov 17, 2026 | 23 |
| Nov 16, 2026 | 24 |
| Nov 15, 2026 | 24 |
| Nov 14, 2026 | 15 |
| Nov 13, 2026 | 17 |
| Nov 12, 2026 | 15 |
| Nov 11, 2026 | 8 |
| Nov 10, 2026 | 17 |
| Nov 9, 2026 | 16 |
| Nov 8, 2026 | 13 |
| Nov 7, 2026 | 13 |
| Nov 6, 2026 | 11 |
| Nov 5, 2026 | 12 |
| Nov 4, 2026 | 10 |
| Nov 3, 2026 | 3 |
| Nov 2, 2026 | 5 |
| Nov 1, 2026 | 5 |
| Oct 31, 2026 | 7 |
| Oct 30, 2026 | 7 |
| Oct 29, 2026 | 6 |
| Oct 28, 2026 | 6 |
| Oct 27, 2026 | 5 |
| Oct 26, 2026 | 6 |
| Oct 25, 2026 | 7 |
| Oct 24, 2026 | 10 |
| Oct 23, 2026 | 10 |
| Oct 22, 2026 | 11 |
| Oct 21, 2026 | 12 |
| Oct 20, 2026 | 11 |
| Oct 19, 2026 | 8 |
| Oct 18, 2026 | 7 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 2 |
| Oct 15, 2026 | 1 |
| Oct 14, 2026 | 8 |
| Oct 13, 2026 | 8 |
| Oct 12, 2026 | 8 |
| Oct 11, 2026 | 9 |
| Oct 10, 2026 | 9 |
| Oct 9, 2026 | 12 |
| Oct 8, 2026 | 12 |
| Oct 7, 2026 | 5 |
| Oct 6, 2026 | 5 |
| Oct 5, 2026 | 6 |
| Oct 4, 2026 | 5 |
| Oct 3, 2026 | 6 |
| Oct 2, 2026 | 14 |
| Oct 1, 2026 | 14 |
| Sep 30, 2026 | 13 |
| Sep 29, 2026 | 14 |
| Sep 28, 2026 | 14 |
| Sep 27, 2026 | 14 |
| Sep 26, 2026 | 17 |
| Sep 25, 2026 | 6 |
| Sep 24, 2026 | 6 |
| Sep 23, 2026 | 6 |
| Sep 22, 2026 | 8 |
| Sep 21, 2026 | 18 |
| Sep 20, 2026 | 18 |
| Sep 19, 2026 | 14 |
| Sep 18, 2026 | 15 |
| Sep 17, 2026 | 26 |
| Sep 16, 2026 | 28 |
| Sep 15, 2026 | 26 |
| Sep 14, 2026 | 15 |
| Sep 13, 2026 | 20 |
| Sep 12, 2026 | 21 |
| Sep 11, 2026 | 22 |
| Sep 10, 2026 | 13 |
| Sep 9, 2026 | 13 |
| Sep 8, 2026 | 12 |
| Sep 7, 2026 | 15 |
| Sep 6, 2026 | 16 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/706679910-root)<a href="https://payloaddirectory.dev/plugins/706679910-root"><img src="https://payloaddirectory.dev/badge/706679910-root.svg" alt="Payload Directory"></a>README
Turbocharge your website performance by creating ultralight image placeholders, resulting in a smoother user experience.
1.7.2 or higher is required (version 2.0.0 or higher is recommended)Instal the package with yarn add @zapal/payload-blurhash-plugin or npm install @zapal/payload-blurhash-plugin
Now setup the plugin within your payload.config.ts file as follows:
import { buildConfig } from 'payload/config';
import { blurHash } from '@zapal/payload-blurhash-plugin';
import path from 'path';
/* ... */
export default buildConfig({
plugins: [
blurHash({
collections: ['team-photos-collection', 'blog-images-collection'],
}),
],
/* ... */
});
The plugin will generate a readonly blurhash field for each image uploaded to the specified collections. Generation
for imageSizes are not supported yet (but it's in progress).
The proper way to conditionally enable/disable this plugin is to use the enabled property.
blurHash({
enabled: process.env.ENABLE_BLURHASH_PLUGIN === 'true',
collections: ['team-photos-collection', 'blog-images-collection'],
}),
This plugin is configurable to work across upload-enabled Payload collections. A * denotes that the property is
required.
| Option | Type | Description |
|---|---|---|
collections * | string[] | Array of upload-enabled collections' slugs you want to enable the plugin for. |
enabled | boolean | Conditionally enable/disable plugin. Default: true. |
width | number | Width to resize the image before computing the blurhash. Default: 32. |
height | number | Height to resize the image before computing the blurhash. Default: 32. |
componentX | number | X component count to pass to the blurhash encoder. Default: 3. |
componentY | number | Y component count to pass to the blurhash encoder. Default: 3. |
See more information about the width, height, componentX, componentY options and BlurHash encoder
here.
You can find the source code in the src directory. For development purposes, you can use the dev directory with all
the necessary files to test the plugin in a Payload project. Also we are strongly recommending to use your IDE debugger
instead of console.log statements.
You need to follow these steps to start developing and testing the plugin locally:
dev directory (cd dev).env file (cp .env.example .env).env filenpm i)npm run dev)And you are ready to go!
We are open to, and grateful for, any contributions made by the community.
We are planning to add more features to this plugin in the future. If you have any ideas, create an issue to discuss it.
Next steps (v1):
imageSizes (in progress)Next steps (v2):
This project is licensed under the MIT License
payloadcms plugin image optimizer
Client-side resize, ThumbHash blur placeholders, filename strategies and bulk regeneration on top of Payload's sharp…
79666/wk27v3
payload plugin aspect preview
Live multi-aspect-ratio previews with crop and focal point editing for Payload upload collections
78174/wk6v3
blur data urls
Generate blur placeholder data URLs automatically for images uploaded to Payload media collections
66139/wk84v3
image framing
Non-destructive crop and focus areas for Payload uploads, with per-usage overrides and responsive framing
6080/wk2v3
images
On-demand Sharp image transforms with focal-point cropping, built-in LQIP placeholders and a favicons collection
6032/wk37v3
payload blurhash
Generates a tiny base64 WebP blur placeholder automatically for image uploads in Payload collections
568/wk3v3