mirror of
https://github.com/philips/supernote-obsidian-plugin.git
synced 2026-07-22 09:50:25 +00:00
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. |
||
|---|---|---|
| .. | ||
| .github/workflows | ||
| src | ||
| .eslintrc.yml | ||
| .prettierrc | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
fast-bmp
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);