Making or manufacturing image
This module is installed via npm:
npm install image-maker
make bmp file with color data
const { getFullBmp } = require('image-maker');
const fs = require('fs');
const redBlock = Buffer.from([0, 0, 255]);
const blueBlock = Buffer.from([255, 0, 0]);
const redBlueBlock = Buffer.concat([redBlock, redBlock, blueBlock, blueBlock]);
const myBmp = getFullBmp({ colorsData: redBlueBlock, width: 2, height: 2 });
fs.writeFile('red_blue.bmp', myBmp, (err) => {
if (err) throw err;
console.log('"red_blue.bmp" file created.');
});