Adds automatic base64 encoding of uploaded images to Payload upload collections, useful as low-quality blur placeholders. Registered through the plugins array in the Payload config and applies to all upload collections by default. Options allow limiting collections, adjusting placeholder size between 4 and 64, and toggling alpha channel removal. Targets Payload 1.x.
Payload CMS plugin for automatic base64 encoding of images
Installation
npm i payload-base64-plugin17
Stars
3
Forks
2
Open Issues
3 years ago
Last Updated
0
Weekly Downloads
v1.2.0
npm Version
13.2 KB
Unpacked Size
1
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
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/571626986-root)<a href="https://payloaddirectory.dev/plugins/571626986-root"><img src="https://payloaddirectory.dev/badge/571626986-root.svg" alt="Payload Directory"></a>README
Payload CMS plugin for automatic base64 encoding of images.
npm i payload-base64-plugin or yarn add payload-base64-plugin.payload.config.ts:import generateBase64 from 'payload-blurhash-plugin';
export default buildConfig({
/* ... */
plugins: [generateBase64()],
});
Optionally, you can pass the following options to tweak the behavior of the plugin:
export interface Base64PluginOptions {
/*
* Array of collection slugs that the plugin should apply to.
* By default, the plugin will apply to all collections with `upload` properties.
*/
collections?: CollectionConfig['slug'][];
/*
* an integer (between 4 and 64) to adjust the returned placeholder size
* Default: 4
*/
size?: number;
/*
* turn on/off the alpha channel removal
* Default: true
*/
removeAlpha?: boolean;
}
This plugin is heavily based on the plugin payload-blurhash-plugin by invakid404.
Since I only changed the encoding to base64, I decided to fork the original plugin instead of creating a new one.
Thank you a lot for your work!
payload plugin aspect preview
Crop and focal point editing with live multi-aspect-ratio previews for Payload upload collections
7534/wk6v3
blur data urls
Generates blur placeholder data URLs for images uploaded to Payload media collections
6966/wk83v3
payload media
Search Unsplash, Pexels and Pixabay stock images and videos from Payload upload collections
680/wk8v4
images
On-demand Sharp image transforms with focal points, built-in blur placeholders and a favicons collection
570/wk37v3
payload icons
SVG icon upload collection with automatic optimization and a server component to render icons inline
560/wk18v3
payload images
On-demand Sharp image transforms with focal-point cropping, placeholders and a responsive image component
550/wk18v3