lwim

Light Weight Image Manipulation for NodeJS. It is forked from mono-bitmap
Installation
$ npm install --save lwim
Features
- Creating bitmaps (1, 2 or 4 bytes per pixel, in big- or little-endian)
- Changing the color depth
- Reading 8-bit .bmp files
- Saving .bmp files
- Getting/setting pixels
- Change the color of every pixel in a specific color
- Drawing rectangles (horizontal gradient in greyscale possible)
- Drawing circles/ellipses
- Inverting the bitmap
- Drawing a bitmap or a portion of it on a bitmap
- Drawing text with a bitmap font
Example
"use strict";
var lwim = require("..");
var bitmap = lwim.bitmap(411, 305);
bitmap.drawFilledRect(10, 10, 100, 50, 0x00, 0xff);
bitmap.drawEllipse(50, 100, 200, 100, 0x00, 0xff);
var overlayBitmap = lwim.bitmap.fromFile("overlayBitmap.bmp");
bitmap.drawBitmap(overlayBitmap, 200, 0, overlayBitmap.palette.indexOf(0xff00ff));
var font = new lwim.Font("P:\\ath\\to\\Font.json");
font.setSize(20);
bitmap.drawText(font, "Hello World!", 10, 100);
var data = bitmap.data;
Documentation
The documentation can be generated from the source code by:
[jsdoc](http://usejsdoc.org/) index.js
License
MIT © taoyuan