cialis online pharmacy generic xenical cheap cialis online cialis generic viagra online in canada buy cheap levitra online cialis without a perscription order viagra uk no prescription flagyl cheap generic levitra buying viagra in the uk cheap viagra approved cialis deltasone online buy viagra online without prescription non prescription cialis buy orlistat uk buy cialis in india prednisone 60 mg female viagra online buy viagra without prescription celebrex prescriptions buy cialis canada best prices viagra alternative to prednisone cheapest generic levitra levitra 5mg cheap viagra cialis on line buy xenical without prescription online accutane canadian health care prednisone no prescreption viagra online generic female viagra europe buy cialis low price cheap india viagra

EasyImage – Nodejs Image Processing Module

Today’s featured web development tool is called EasyImage from hacksparrow, a module that will make image processing and manipulation in Node.js a little more less complicated, not just for beginners but advanced users as well. Server side technologies like ImageMagick is one of the most popular choices for image processing in Node.js, but its syntax can be so complicated and the method of calling it only makes things even worse for the developer. That’s where EasyImage comes in!

EasyImage is built on top of ImageMagick, so in order for you to use it, you first must need to have the latter installed.

Installing ImageMagick on Ubuntu

$ apt-get install imagemagick

Installing ImageMagick on Mac OS X

$ brew install imagemagick

Installing ImageMagick on CentOS

$ yum install imagemagick

Installing EasyImage

$ npm install easyimage

To use EasyImage, simply do

var easyimg = require('easyimage');

And then you simply call its methods to perform various image manipulation tasks like resizing, cropping, etc. Examples below:

To convert an image’s format to another:

easyimg.convert(<options>, <callback_function>)

In application, it’ll look something like this:

easyimg.convert({src:'beach.jpg', dst:'beach.png', quality:10}, function(err, stdout, stderr) {
if (err) throw err;
console.log('Converted JPG to PNG, quality set at 10/100');

You can specify the quality level of the image from 0 to 100 (with 100 being the best and 0 the worst)

To resize an image:

easyimg.resize(<options>, <callback_function>)


easyimg.resize({src:'beach.jpg', dst:'beach-small.jpg', width:640, height:480}, function(err, stdout, stderr) {
if (err) throw err;
console.log('Resized to 640x480');

You can find more examples HERE. Last but not least, you can execute ImageMagic convert commands yourself from EasyImage.

Related Posts

Adding Instagram Badges to Your WordPress Profile

How to Create a Custom WordPress Registration Form with Flat UI

How to Create A Basic Hipster-Style Layout

How to Style Nav Links Using Floats With HTML5 and CSS3