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

images

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

images

Cross-platform image decoder(png/jpeg/gif) and encoder(png) for Nodejs

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30K
increased by185.58%
Maintainers
1
Weekly downloads
 
Created
Source

node-images

Cross-platform image decoder(png/jpeg/gif) and encoder(png) for Nodejs

Installation

$ npm install images

Usage

var images = require("images"), //npm
//  images = require("./index.js"), //git
    fs = require(""fs);

var img = images.loadFromBuffer(fs.readFileSync("demo/img/rotating_earth.gif"));
fs.writeFileSync("demo/output/gif2png.png", img.toBuffer(images.TYPE_PNG));

API

node-images provide jQuery-like Chaining API, You can start the chain like this:

images.createImage(width, height).XXXX()
// OR
images.loadFromBuffer(buffer[, start[, end]]).XXXX()
// OR
images.copyFromImage(image[, x, y, width, height]).XXXX()

.createImage(width, height)

Create a new transparent image

.loadFromBuffer(buffer[, start[, end]])

Load and decode image from a buffer See demo/loadFromBuffer.js

.copyFromImage(image[, x, y, width, height])

Copy from another image See demo/copyFromImage.js

.fillColor(red, green, blue[, alpha])

See demo/fillColor.js

.drawImage(image, x, y)

See demo/drawImage.js

.size([width, height])

Return image size or TODO:set image size

{
	width:123,
	height:456
}

.width([width])

Return image width or TODO:set image width

.height([height])

Return image height or TODO:set image height

Keywords

FAQs

Package last updated on 26 Feb 2013

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