imagemagickresizer

1.0.3 • Public • Published

imagemagickresizer

A node library to resize images using ImageMagick

you need ImageMagick on your system

install

You need imagemagick on your machine.

For Windows - download the ImageMaigck Installer

For Linux:

$ sudo apt-get install imagemagick

usage

Resize a folder of images and write to a new folder.

Each image is resized multiple times.

var resize = require('imagemagickresizer')()

resize.folder('./imgs', './output', [{
  width:1024,
  height:768
},{
  width:102,
  height:77,
  name:'thumb'
}], function(){
	console.log('images resized!');
})

Resize a single image and control what size the output is written at:

resize.image('./imgs/balloon.jpg', './output/balloon.jpg', {
	width:600,
	height:400
}, function(err){
	console.log('image is resized')
})

If ./imgs was a folder with:

  • image1.png (2048 x 1536)
  • image2.png (2048 x 1536)

Then ./output would contain:

  • image1.png (1024 x 768)
  • image1.thumb.png (102 x 77)
  • image2.png (1024 x 768)
  • image2.thumb.png (102 x 77)

installation

$ npm install imagemagickresizer

Package Sidebar

Install

npm i imagemagickresizer

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • binocarlos