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

ablend

v0.1.0

Published

Combines 2 images (one on white and one on black) to produce a transparent version.

Readme

ablend

Combines 2 images (one on white and one on black) to produce a transparent version.

Based on my old screenshot tool for Linux abscapture and my Compiz 0.8 plugin windowcapture. Inspired by Windows screenshot tool Window Clippings.

This app doesn't have screenshot facilities, just the ability to blend together two images to produce a transparent image.

API

var ablend = require('ablend');

exports.ablend(a, b, o, onprogress)

Blends the images a and b and save into o.

a, b and o must be an ImageData object and have same dimensions.

  • a - an ImageData object representing an image on black background, read-only
  • b - an ImageData object representing an image on white background, read-only
  • o - an ImageData object representing the output image, write-only
  • onprogress - function(current, total) will be fired every pixel processed

exports.cblend(ca, cb, ba, bb, o)

Blends two colors ca and cb and save the result into o.

The color o will be set so that when it is displayed on ba will result in ca and when displayed on bb will result in cb.

  • ca - the color object for the color that is displayed on ba.
  • cb - the color object for the color that is displayed on bb.
  • ba - the color object for first background color.
  • bb - the color object for second background color.
  • o - the color object for output.

Color Objects

{
  "r": (red value from 0 to 255),
  "g": (green value from 0 to 255),
  "b": (blue value from 0 to 255),
  "a": (alpha value from 0 to 255)
}

exports.alpha(va, vb, ba, bb)

Given two colors and two backgrounds, compute the opacity.

  • va - the value of the color on background A.
  • vb - the value of the color on background B.
  • ba - the value of the background color A.
  • ba - the value of the background color B.
  • Returns the alpha value, between 0 and 1 inclusive.

Color Values

The value of a color is defined to be the sum of red, green and blue channel.

For example, the value of black is 0, and white is 765 (255*3).

exports.value(va, vb, ba, bb, a)

  • va - the value of the color on background A.
  • vb - the value of the color on background B.
  • ba - the value of the background color A.
  • bb - the value of the background color A.
  • a - the alpha value, returned by exports.alpha.
  • Returns the color value, that will result in va when displayed with opacity a on background color ba, and vb when displayed on background color bb.

Color Values

For this function, the value of the color is the value of each channel.

Dependencies

The core algorithm (lib/ablend.js) doesn't depend on anything, but the CLI script uses learnboost/node-canvas to read and write images and substack/node-optimist to parse command-line arguments.