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

@jimp/js-bmp

v2.3.0

Published

<div align="center"> <img width="140" alt="" src="https://raw.githubusercontent.com/jimp-dev/jimp/main/.github/assets/jimpy.png"> <h1>@jimp/js-bmp</h1> <p>Default Jimp bmp encoder/decoder.</p> </div>

Downloads

10,935,828

Readme

BMPs are written as uncompressed 24-bit images by default. Pass bitPP to write 16-bit (5 bits per channel) or 32-bit BMPs instead:

import { Jimp } from "jimp";

const image = await Jimp.read("test/image.png");

await image.write("out.bmp", { bitPP: 16 });
const buffer = await image.getBuffer("image/bmp", { bitPP: 32 });

1, 4 and 8-bit BMPs

bitPP: 1, 4 and 8 write each pixel as an index into a palette of up to 2, 16 or 256 colours. Without a palette option:

  • If the image has few enough colours, those colours are the palette, so nothing is lost.
  • Otherwise a 1-bit BMP is black and white: pixels whose Rec. 709 luminance is over half are white.
  • Otherwise a 4 or 8-bit BMP gets a palette of the image's most important colours, from image-q's Wu quantizer. Each pixel is the nearest palette colour, without dithering.

To dither, reduce the image's colours before writing it. The image then has few enough colours to be written exactly:

// 1-bit, black and white
image.dither({ type: "floyd-steinberg" });
await image.write("out.bmp", { bitPP: 1 });

// 4-bit, 16 colours
image.quantize({ colors: 16 });
await image.write("out.bmp", { bitPP: 4 });

Pass palette to choose the colours yourself, as RGBA hex numbers or CSS colours. Each pixel is written as the nearest palette colour, and alpha is ignored:

await image.write("out.bmp", { bitPP: 1, palette: ["white", "black"] });
await image.write("out.bmp", {
  bitPP: 4,
  palette: [0x000000ff, 0xff0000ff, 0x00ff00ff, 0x0000ffff],
});