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

qr-atomize

v1.2.0

Published

Atomize QR codes to their absolute minimum filesize — 1 pixel per module. Decode and re-render any QR code image (PNG, JPEG, GIF, WebP, BMP, TIFF, ICO) at native resolution. Supports QR codes with embedded logos.

Readme

qr-atomize

Atomize any QR code image to its absolute minimum filesize — 1 pixel per module (without resampling fuzziness or subpixel-rendering issues).

Takes an oversized QR code (PNG, JPEG, GIF, WebP, BMP, TIFF, ICO), decodes it, and re-renders it at native resolution where each symbol module is exactly 1 pixel. Output is a 1-bit PNG (or optionally GIF).

QR codes with embedded logos are fully supported — the logo overlay is discarded during atomization (error correction handles the missing modules).

Example

| Input | Output | |:-----:|:------:| | 290×290 px input (6.9 KB) | 29×29 px output (197 B) | | 290×290 px input (6.9 KB) | 29×29 px output (197 B) — 97% reduction! |

Install

npm install qr-atomize          # as a dependency
npm install -g qr-atomize       # globally for CLI use

CLI

# npx (no install needed)
npx qr-atomize input.png

# global install
qr-atomize input.png
qr-atomize input.jpg -o tiny.png
qr-atomize input.gif --border 0 --format gif
qr-atomize input.bmp
qr-atomize <input> [options]

Options:
  -o, --output <file>   Output path (default: <input>-atomized.png)
  -b, --border <n>      Quiet zone in modules (default: 2)
  -f, --format <fmt>    Output format: png (default) or gif
  -x, --invert          Invert output polarity (swap black/white)
  -h, --help            Show help

Library

// ESM
import atomizeQr from 'qr-atomize';
const png = await atomizeQr(readFileSync('qrcode.png'));

// CommonJS
const atomizeQr = require('qr-atomize').default;
const png = await atomizeQr(readFileSync('qrcode.png'));

API

atomizeQr(input: Buffer | string, opts?: {
  border?: number;       // quiet zone in modules (default: 2)
  format?: 'png' | 'gif' // output format (default: 'png')
  invert?: boolean;      // swap black/white (default: auto-detect from input)
}): Promise<Buffer>
  • input — image buffer or file path (PNG, JPEG, GIF, WebP, BMP, TIFF, ICO)
  • returnsPromise<Buffer> containing the atomized image

Note: atomizeQr is async (returns a Promise) because image decoding uses async operations internally.

Sub-module exports

import { decodeInput, reEncode } from 'qr-atomize';

// decodeInput(buf) → Promise<{ width, height, data }> (raw RGBA pixels)
// reEncode(text, opts?) → Uint8Array (encoded QR image)

How it works

  1. Decode the input image to raw RGBA pixels (via cross-image)
  2. Parse the QR code using finder-pattern detection and error correction
  3. Re-encode the decoded payload at scale: 1 (1 pixel per module) as a 1-bit PNG

This is not a resizer — it's a decode-and-remint operation. The output is guaranteed pixel-perfect.

Supported input formats

| Format | Extension | |--------|-----------| | PNG | .png | | JPEG | .jpg, .jpeg | | GIF | .gif | | WebP | .webp | | BMP | .bmp | | TIFF | .tiff, .tif | | ICO | .ico |

License

MIT