Skip to content

lampaa/imageLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imageLib.js

Module for processing and manipulation images on pure JavaScript

npm install imagelib -g

Install zlib:

npm install zlib -g

Example

var imageLib = require('./imageLib.js');

imageLib(200, 200).create(function() {
    var x, y;

	for(x=20; x < 180; x++) {
		for(y=20; y < 40; y++) {
			this.setPixel(x, y, 255, 0, 0, 255); // black
		}
	}
	
	for(y=0; y < this.height; y++) {
		this.setPixel(0, y, 255, 0, 0, 255);
		this.setPixel(this.width-1, y, 255, 0, 0, 255);
	}

	for(x=0; x < this.width; x++) {
		this.setPixel(x, 0, 255, 0, 0, 255);
		this.setPixel(x, this.height-1, 255, 0, 0, 255);
	}
	
	this.toPng('./images/simple.png');
	this.toJpeg('./images/simple.jpg');
});

API

About

imageLib - image processing via pure language (node.js)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published