New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pixel-bloom

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry
This package was compromised as part of the ongoing "North Korea’s Contagious Interview Campaign" supply chain attack.

Affected versions:

10.29.110.29.410.29.11
View campaign page

pixel-bloom

A lightweight, zero-dependency image filter for Node.js and browsers that adds a cinematic bloom/glow effect with configurable intensity, radius, and blend modes.

latest
npmnpm
Version
10.29.11
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

pixel-bloom

npm version

pixel-bloom is a lightweight image filter for Node.js and the browser that adds a cinematic bloom or glow effect to images. It highlights bright areas, applies smooth blur, and blends the result back to produce soft, glowing highlights — ideal for creative, photo, or UI effects.

Features

✨ Apply threshold-based bloom/glow to any image or pixel buffer

⚡ Fast CPU implementation with separable Gaussian blur

💡 Configurable radius, intensity, blend mode, and threshold

🧠 Linear RGB aware blending for natural, filmic glow

🧩 Works with Node (Buffer), Canvas, or ImageData in browsers

🧰 Optional pipeline caching for batch or realtime processing

Installation

Using npm:

npm install pixel-bloom

Using Yarn:

yarn add pixel-bloom

Usage

Add the bloom effect to an image buffer or canvas:

import { applyBloom } from "pixel-bloom";
import { readFileSync, writeFileSync } from "node:fs";
import { decodePng, encodePng } from "some-png-lib"; // use your preferred decoder/encoder

const { data, width, height } = decodePng(readFileSync("input.png"));

const result = applyBloom(
  { data, width, height },
  {
    threshold: 0.8,      // only affect bright areas
    knee: 0.5,           // smooth transition around threshold
    intensity: 1.2,      // how strong the bloom appears
    radius: 20,          // blur radius (px)
    blendMode: "screen", // 'add' | 'screen' | 'plus-lighter'
    linearRGB: true,     // operate in linear color space
  }
);

writeFileSync("output.png", encodePng({ data: result, width, height }));

Browser Example

import { applyBloomToImageData } from "pixel-bloom";

const canvas = document.querySelector("canvas")!;
const ctx = canvas.getContext("2d")!;

const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const output = applyBloomToImageData(imageData, { radius: 16, intensity: 1.1 });

ctx.putImageData(output, 0, 0);

Configuration Options

OptionTypeDefaultDescription
thresholdnumber (0–1)0.8Luminance threshold for bloom extraction
kneenumber (0–1)0.5Soft knee around threshold to avoid harsh cutoff
radiusnumber16Blur radius (px)
intensitynumber1.0Strength of the bloom glow
blendMode"add" | "screen" | "plus-lighter""screen"Composition mode for blending bloom over base image
linearRGBbooleantrueEnable linear RGB blending for realistic highlights
iterationsnumber4Number of blur passes (higher = smoother)
preserveAlphabooleantrueKeep the original alpha channel
quality"auto" | "fast" | "best""auto"Adjusts kernel size and blur precision

Example Output

[pixel-bloom] ✨ Applied bloom: radius=20, threshold=0.8, intensity=1.2
[pixel-bloom] 📷 Output image: 1920×1080, 14.8 ms

License

MIT © [nanti]

Contributing

Got ideas or improvements? Contributions are welcome! Feel free to open an issue or submit a PR.

Keywords

bloom

FAQs

Package last updated on 20 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts