oversightstudio

blur data urls

by oversightstudio
payload-plugins
Media & images
v3
^3.90.0
MIT

Overview

Summary generated from the README

Adds a blurDataUrl field to the media collections you specify and fills it with a generated blur placeholder whenever an image is uploaded. It is configured through the plugin options in the Payload config and uses sharp for image processing. The blur width, height and strength are adjustable, and the value can be passed to next/image as a blur placeholder.

Features

  • Adds a blurDataUrl field to selected collections
  • Generates the blur data URL on upload
  • Configurable width, height (or auto aspect ratio) and blur amount
  • Migration script to backfill existing images
  • Can be enabled or disabled through a config option

Use cases

  • Show blurred placeholders with next/image while media loads
  • Backfill blur placeholders for an existing media library

From the author

Automatically assign URLs for blur data to media collections in Payload.

Installation

npm i @oversightstudio/blur-data-urls

84

Stars

9

Forks

2

Open Issues

1 months ago

Last Updated

132

Weekly Downloads

v1.0.4

npm Version

11.3 KB

Unpacked Size

0

Dependencies

Repository stars

84+3 since Sep 7

Show data
Repository stars by day (UTC)
DateStars
Dec 6, 202684
Dec 5, 202684
Dec 4, 202684
Dec 3, 202684
Dec 2, 202684
Dec 1, 202684
Nov 30, 202684
Nov 29, 202684
Nov 28, 202684
Nov 27, 202684
Nov 26, 202684
Nov 25, 202684
Nov 24, 202684
Nov 23, 202684
Nov 22, 202684
Nov 21, 202684
Nov 20, 202684
Nov 19, 202684
Nov 18, 202684
Nov 17, 202684
Nov 16, 202684
Nov 15, 202684
Nov 14, 202684
Nov 13, 202684
Nov 12, 202684
Nov 11, 202684
Nov 10, 202684
Nov 9, 202684
Nov 8, 202684
Nov 7, 202684
Nov 6, 202684
Nov 5, 202684
Nov 4, 202684
Nov 3, 202683
Nov 2, 202683
Nov 1, 202683
Oct 31, 202683
Oct 30, 202683
Oct 29, 202683
Oct 28, 202683
Oct 27, 202683
Oct 26, 202683
Oct 25, 202683
Oct 24, 202683
Oct 23, 202683
Oct 22, 202683
Oct 21, 202683
Oct 20, 202683
Oct 19, 202683
Oct 18, 202683
Oct 17, 202683
Oct 16, 202683
Oct 15, 202683
Oct 14, 202683
Oct 13, 202683
Oct 12, 202683
Oct 11, 202683
Oct 10, 202683
Oct 9, 202682
Oct 8, 202682
Oct 7, 202682
Oct 6, 202682
Oct 5, 202682
Oct 4, 202682
Oct 3, 202682
Oct 2, 202682
Oct 1, 202682
Sep 30, 202681
Sep 29, 202681
Sep 28, 202681
Sep 27, 202681
Sep 26, 202681
Sep 25, 202681
Sep 24, 202681
Sep 23, 202681
Sep 22, 202681
Sep 21, 202681
Sep 20, 202681
Sep 19, 202681
Sep 18, 202681
Sep 17, 202681
Sep 16, 202681
Sep 15, 202681
Sep 14, 202681
Sep 13, 202681
Sep 12, 202681
Sep 11, 202681
Sep 10, 202681
Sep 9, 202681
Sep 8, 202681
Sep 7, 202681

Shared by 3 plugins in oversightstudio/payload-plugins.

npm weekly downloads

132−49 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 2026132
Dec 5, 2026150
Dec 4, 2026126
Dec 3, 2026129
Dec 2, 2026138
Dec 1, 2026196
Nov 30, 2026212
Nov 29, 2026203
Nov 28, 2026209
Nov 27, 2026211
Nov 26, 2026192
Nov 25, 2026169
Nov 24, 2026120
Nov 23, 2026119
Nov 22, 2026150
Nov 21, 2026151
Nov 20, 2026175
Nov 19, 2026258
Nov 18, 2026259
Nov 17, 2026254
Nov 16, 2026243
Nov 15, 2026214
Nov 14, 2026210
Nov 13, 2026201
Nov 12, 2026137
Nov 11, 2026167
Nov 10, 2026338
Nov 9, 2026343
Nov 8, 2026361
Nov 7, 2026336
Nov 6, 2026346
Nov 5, 2026336
Nov 4, 2026298
Nov 3, 2026148
Nov 2, 2026144
Nov 1, 2026147
Oct 31, 2026149
Oct 30, 2026139
Oct 29, 2026121
Oct 28, 2026109
Oct 27, 202686
Oct 26, 202693
Oct 25, 202687
Oct 24, 2026107
Oct 23, 202677
Oct 22, 2026107
Oct 21, 2026124
Oct 20, 2026140
Oct 19, 2026136
Oct 18, 2026121
Oct 17, 2026121
Oct 16, 2026126
Oct 15, 2026104
Oct 14, 2026115
Oct 13, 202695
Oct 12, 202691
Oct 11, 202679
Oct 10, 202659
Oct 9, 202671
Oct 8, 202670
Oct 7, 202655
Oct 6, 202658
Oct 5, 202653
Oct 4, 202654
Oct 3, 202658
Oct 2, 202660
Oct 1, 202661
Sep 30, 202666
Sep 29, 202666
Sep 28, 202673
Sep 27, 202690
Sep 26, 202695
Sep 25, 202691
Sep 24, 202688
Sep 23, 2026108
Sep 22, 2026108
Sep 21, 2026127
Sep 20, 2026193
Sep 19, 2026213
Sep 18, 2026290
Sep 17, 2026330
Sep 16, 2026372
Sep 15, 2026401
Sep 14, 2026409
Sep 13, 2026361
Sep 12, 2026347
Sep 11, 2026293
Sep 10, 2026277
Sep 9, 2026225
Sep 8, 2026210
Sep 7, 2026181

Each point is npm's rolling 7-day download count.

Health Score

66/100Good

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/932147916-blur-data-urls.svg)](https://payloaddirectory.dev/plugins/932147916-blur-data-urls)
HTML
<a href="https://payloaddirectory.dev/plugins/932147916-blur-data-urls"><img src="https://payloaddirectory.dev/badge/932147916-blur-data-urls.svg" alt="Payload Directory"></a>
Updated Oct 23, 2026Created Feb 13, 2025Published Feb 23, 2025

README

Blur Data URLs Payload Plugin

Install

pnpm add @oversightstudio/blur-data-urls sharp

About

This plugin automatically assigns URLs for blur data to media collections in Payload. It will automatically add the blurDataUrl field to the collections you provide and automatically generate and assign a blurDataUrl to the field whenever a media item is uploaded.

Payload Setup

import { buildConfig } from 'payload'
import { blurDataUrlsPlugin } from '@oversightstudio/blur-data-urls'
import { Media } from './collections/Media'

export default buildConfig({
  plugins: [
    blurDataUrlsPlugin({
        enabled: true,
        collections: [Media],
        // Blur data URLs Settings (Optional) 
        blurOptions: {
            blur: 18,
            width: 32,
            height: "auto",
        }
    }),
  ],
})

Options

OptionTypeDefaultDescription
enabledbooleantrueWhether the plugin is enabled.
collectionsPluginCollectionConfig[]RequiredA list of collections where blurDataUrl should be implemented. Should typically be the main media collection.
blurOptionsobjectOptionalAdditional settings for generating blurDataUrls.

blurOptions Settings

OptionTypeDefaultDescription
widthnumber32Width of the blurDataUrl.
heightnumber | 'auto''auto'Height of the blurDataUrl. If 'auto', it maintains the image’s aspect ratio.
blurnumber18The amount of blur applied to the generated blurDataUrl.

Usage with next/image

import Image from 'next/image'

<Image
// Your other image settings
placeholder="blur"
blurDataURL={image.blurDataUrl ?? undefined}
/>

Generating BlurData URLs for Existing Images

If you already have images in your media collection, you might want to generate blurDataUrls for them.

To do so:

  1. Place this script on your ./src/scripts/ directory.
  2. Make sure you have tsx installed either globally or on your project. You can uninstall it after running the script.
  3. Modify the plugin configuration on the script. You'll be able to set the blur options + which collections to migrate.
  4. Run the script: tsx ./src/scripts/blurDataUrlsMigrationScript.ts
  5. Let it cook.

Credits

  • Shoutout to Paul for being a real one.

Similar plugins