New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lwim

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lwim

Light Weight Image Manipulation for NodeJS

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-14.29%
Maintainers
1
Weekly downloads
 
Created
Source

lwim

NPM version Build Status Dependency Status Coverage percentage

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("..");

// Create bitmap
var bitmap = lwim.bitmap(411, 305);

// Draw rectangle with border
bitmap.drawFilledRect(10, 10, 100, 50, 0x00, 0xff);
bitmap.drawEllipse(50, 100, 200, 100, 0x00, 0xff);

// Draw another bitmap with some source pixels in a specific color handled as transparent
var overlayBitmap = lwim.bitmap.fromFile("overlayBitmap.bmp");
bitmap.drawBitmap(overlayBitmap, 200, 0, overlayBitmap.palette.indexOf(0xff00ff/*magenta*/));

// Draw text
var  font = new lwim.Font("P:\\ath\\to\\Font.json");
font.setSize(20);
bitmap.drawText(font, "Hello World!", 10, 100);

// The raw pixel data can also be processed in a user-specific way
var data = bitmap.data;  // Return a Node.js Buffer

Documentation

The documentation can be generated from the source code by:

[jsdoc](http://usejsdoc.org/) index.js

License

MIT © taoyuan

Keywords

FAQs

Package last updated on 03 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc