philips_supernote-obsidian-.../node_modules/fast-bmp
Brandon Philips 2518e666d2 node_modules: initial import
Since there is no native code I am just checking all of the dependencies
in to simplify life and avoid a hard dependency on npm working on any
given day.
2024-04-05 23:08:52 -07:00
..
.github/workflows node_modules: initial import 2024-04-05 23:08:52 -07:00
src node_modules: initial import 2024-04-05 23:08:52 -07:00
.eslintrc.yml node_modules: initial import 2024-04-05 23:08:52 -07:00
.prettierrc node_modules: initial import 2024-04-05 23:08:52 -07:00
CHANGELOG.md node_modules: initial import 2024-04-05 23:08:52 -07:00
package.json node_modules: initial import 2024-04-05 23:08:52 -07:00
README.md node_modules: initial import 2024-04-05 23:08:52 -07:00

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);