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

pixel-data-js

v0.4.0

Published

JS Pixel and ImageData operations

Readme

Pixel Data JS

A 🔥Performance🔥 library of functions for interacting with pixel data and ImageData objects. This package is designed to be a tree-shake friendly list of functions.

Documentation

Installation

$ npm i pixel-data-js

High-Performance Pixel Manipulation with Uint32Array

The ImageData.data object is a Uint8ClampedArray. It is easy to use but, it is inefficient for heavy processing because every single pixel requires four separate write operations (Red, Green, Blue, and Alpha). By using a Uint32Array view, we can treat all four color channels as a single 32-bit integer, allowing us to update an entire pixel in a single CPU operation.

The Concept: 32-bit Packing

A single pixel consists of four 8-bit channels (R, G, B, A). The entire color's data can fit into a single 32-bit unsigned integer 8 * 4 = 32 (Color32).

Example

import { packColor } from 'pixel-data-js'

const ctx = canvas.getContext('2d')
const imageData = ctx.getImageData(0, 0, width, height)

// 1. Get the underlying buffer
const buffer = imageData.data.buffer

// 2. Create a 32-bit view of that same buffer
const data32 = new Uint32Array(buffer)

// 3. Write a single pixel (Red: 255, Green: 100, Blue: 0, Alpha: 255)
// This is 4x faster than writing to imageData.data[i...i+3]
data32[0] = packColor(255, 100, 0, 255)

// 4. Push back to canvas
ctx.putImageData(imageData, 0, 0)

Color Integers

You can define colors using the AABBGGRR (Little-Endian) to make a Color32 object.

Building

$ pnpm install

$ pnpm run build

Testing

$ pnpm run test

$ pnpm run test:mutation

Releases Automation

  • update package.json file version (example: 1.0.99)
  • manually create a github release with a tag matching the package.json version prefixed with v (example: v1.0.99)
  • npm should be updated automatically