npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lxgicstudios/blurhash-gen

v1.0.0

Published

Generate BlurHash-style base64 placeholder strings for images. Output as CSS background, data-URI, or raw hash with zero dependencies.

Readme

@lxgicstudios/blurhash-gen

npm version license node zero deps

Generate BlurHash-style base64 placeholder strings for images. Read image dimensions from headers, create tiny color-averaged placeholders. Output as CSS background, data-URI, or raw hash. Zero dependencies.

Install

# Run directly
npx @lxgicstudios/blurhash-gen photo.jpg

# Or install globally
npm i -g @lxgicstudios/blurhash-gen

Usage

# Generate CSS placeholder for a single image
blurhash-gen hero.jpg

# Process all images in a directory
blurhash-gen --batch ./images

# Output as data-URI for img src placeholder
blurhash-gen --format data-uri photo.png

# Raw base64 hash
blurhash-gen --format raw banner.webp

# JSON output for build tools
blurhash-gen --json --batch ./public/images

# Custom placeholder grid size
blurhash-gen --width 6 --height 4 photo.jpg

Features

  • Multiple output formats: CSS linear-gradient, SVG data-URI, or raw base64
  • Image header parsing reads dimensions from PNG, JPEG, GIF, WebP, and BMP without decoding
  • Batch processing scans directories recursively for all image files
  • Color sampling extracts average color from image data
  • Gradient generation creates smooth color variations for realistic blur effect
  • SVG data-URI output includes Gaussian blur filter for smooth results
  • Configurable grid size controls placeholder detail level
  • JSON output for integration with build tools and frameworks
  • Zero external dependencies (pure Node.js builtins)

Output Formats

CSS (default)

background: linear-gradient(180deg, rgb(142,158,172) 0%, rgb(138,155,170) 50%, rgb(134,152,168) 100%);
background-size: cover;
aspect-ratio: 1920 / 1080;

Data URI

A tiny SVG with colored rectangles and a Gaussian blur filter, encoded as base64. Drop it into an img tag's src as a loading placeholder.

Raw

Base64-encoded color grid data. Compact format for storing in databases or APIs.

Supported Formats

| Format | Dimensions | Color Sampling | |--------|-----------|----------------| | PNG | ✓ | ✓ | | JPEG | ✓ | ✓ | | GIF | ✓ | ✓ | | WebP | ✓ | ✓ | | BMP | ✓ | ✓ |

Options

| Option | Description | Default | |--------|-------------|---------| | --batch <dir> | Process all images in a directory | - | | --format <type> | Output format: css, data-uri, or raw | css | | --width <n> | Placeholder grid width | 4 | | --height <n> | Placeholder grid height | 3 | | --json | Output results as JSON | false | | --help | Show help message | - |

Example Output

 blurhash-gen v1.0.0

Processing 3 image(s)...

  ✓ images/hero.jpg
    Dimensions:  1920x1080  (JPEG, 245.2 KB)
    Avg color:   rgb(142, 158, 172)
    Format:      css
    Output:
      background: linear-gradient(180deg, rgb(142,158,172) 0%, ...);
      background-size: cover;
      aspect-ratio: 1920 / 1080;

 Done  3 placeholder(s) generated

License

MIT - LXGIC Studios