Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

native port of imagemagick

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
Octocat-spinner-32 wscript


magickwand is the native port of imagemagick/convert, that can be used to resize and compress images. This can be used to dynamically resize images in an express/connect based server. See examples/cdn.js for a sample connect middleware.

Most other ports of imagemagick invoke the convert binary, instead of making direct API calls. While this works, API calls would be faster than invoking convert, and that is the motivation for this module.


var magickwand = require('magickwand');
var fs = require('fs');

magickwand.resize('<pathtoimagefile>', { width: 300, height: 200, quality: 80 } ,function(err,data) {

To maintain aspect ratio while resizing, set one of the width/height parameters to 0.

magickwand.resize('<pathtoimagefile>', { width: 100 },function(err,data) {

See examples/cdn.js on how to use this module as a middleware in connect.


magickwand uses the C library by the same name, so libmagickwand-dev should be installed. Also, pkg-config is used while building.

On Ubuntu, for example

sudo apt-get install libmagickwand-dev pkg-config

On Mac - you can use homebrew to install imagemagick.

brew install imagemagick 

On MacOS, I had trouble using the default recipie for imagemagick, as openmp would cause node process to hang. Make sure you have disabled openmp while building Imagemagick.If you use homebrew, use the --disable-openmp option while installing imagemagick.


$ npm install magickwand

Source Install / Manual Compilation

$ git clone git://
$ node-waf configure build
Something went wrong with that request. Please try again.