mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-01 00:50:04 +00:00
9 lines
352 B
TypeScript
9 lines
352 B
TypeScript
import { decode, encode } from "bmp-js";
|
|
import { readFileSync, writeFileSync } from "fs";
|
|
|
|
const bmpBuffer = readFileSync('grayscale.bmp');
|
|
const decoded = decode(bmpBuffer);
|
|
const { width, height, data } = decoded;
|
|
console.log("got bmp with %s x %s (%s bytes)", width, height, data.byteLength);
|
|
writeFileSync("testoutput.bmp", encode(decoded).data);
|