Nourished Personal Mucus

This package has been deprecated

Author message:

WARNING: This project has been renamed to bitmap-manipulation. Install using bitmap-manipulation instead.

mono-bitmap

0.0.2 • Public • Published

mono-bitmap

node.js package to create in-memory monochrome bitmaps.

Build Status

Features

  • Create a greyscale bitmap in a node.js Buffer.
  • Use 1, 2 or 4 bytes per pixel, in big or little endian.
  • Basic drawing operations
    • Set individual pixels to greyscale colors.
    • Filled rectangle with border
    • Rectangle filled with a horizontal gradient.

Example

var MonochromeBitmapImage = require('mono-bitmap');
// create 100x50 image with 2 bytes per pixel in little-endian order.
var image = new MonochromeBitmapImage(100, 50, 2, MonochromeBitmapImage.Endian.LITTLE);
// draw a rectangle with medium-grey border, filled with white
image.drawFilledRect(10, 10, 80, 30, 32817, 65535);
// put a gradient from black to white inside the rectangle
image.drawGradientRect(20, 20, 60, 10, 0, 65535);
 
// write pixel data to file
var fs = require('fs');
var stream = fs.createWriteStream('image.raw');
stream.write(image.data());
stream.end();

License

MIT

Keywords

install

npm i mono-bitmap

Downloadsweekly downloads

0

version

0.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability