Skip to content

meltingice/CamanJS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About the Project

The main focus of CamanJS is manipulating images using the HTML5 canvas and Javascript. It's a combination of a simple-to-use interface with advanced and efficient image/canvas editing techniques. It is also completely library independent and can be safely used next to jQuery, YUI, Scriptaculous, MooTools, etc.

CamanJS is very easy to extend with new filters and plugins, and it comes with a wide array of image editing functionality, which is only growing as the community makes more plugins.

For more information, I highly recommend taking a look at the official website where there is more comprehensive documentation and interactive demos. You can also read the wiki for some basic information about the project and how to use it.

Node Dependencies

In order to run CamanJS in Node, we need to simulate the HTML canvas. Because of that, there are a few dependencies:

  • cairo >= 1.10.0
    • Beware: the version in Homebrew is not up to date.
  • libjpeg
  • node-canvas

How to Use

Install

CamanJS is now a part of npm. Simply run:
npm install caman

It will install the node-canvas dependency if you don't have it installed already.

Usage

Using CamanJS is simple. It goes something like this:
var Caman = require('caman').Caman;

Caman('path/to/image.jpg', function () {
	this.brightness(10);
	this.contrast(-5);
	this.saturation(-50);
	// and so on...
	
	this.render(function () {
		/*
		 * Currently only supports writing to PNG files.
		 * 2nd parameter forces CamanJS to overwrite the output
		 * file if it already exists.
		 */
		this.save("path/to/output.png", true);
	});
});

Project Contributors

About

Javascript HTML5 (Ca)nvas (Man)ipulation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 15