fast-bmp

2.0.1 • Public • Published

fast-bmp

NPM version Test coverage npm download

A library for encoding bmp image file format.

Supported features

For now there is only support for 1-bit image encoding.

Usage

const bmp = require('fast-bmp');

// 0 0 0 0 0
// 0 1 1 1 0
// 0 1 0 1 0
// 0 1 1 1 0
// 0 0 0 0 0
const imageData = {
  width: 5,
  height: 5,
  data: new Uint8Array([0b00000011, 0b10010100, 0b11100000, 0b00000000]),
  bitDepth: 1,
  components: 1,
  channels: 1,
};
// Encode returns a Uint8Array.
const encoded = bmp.encode(imageData);
fs.writeFileSync('image.bmp', encoded);

Readme

Keywords

none

Package Sidebar

Install

npm i fast-bmp

Weekly Downloads

13,118

Version

2.0.1

License

MIT

Unpacked Size

15.5 kB

Total Files

22

Last publish

Collaborators

  • lpatiny
  • stropitek
  • targos
  • cheminfo-bot