Batch images resizing [NO NATIVE DEPENDENCIES NEEDED]

Easy module for resizing of large amount of images

Powered by Jimp which does not require any native dependencies

Just use

image-batch -D path/to/images --resize 50% --postfix m

Motivation

Need to resize huge amount of images.

For example here is directory with big amount of device mockups of different image types:

iphone_6.png iphone_6_gold.jpg iphone_mockup.jpg mockup_htc_8.png galaxy-note-4-psd-mockup.png

The task: Produce iPhone mockups of 3 types(100% size with -l postfix, 50% size with -m postfix and 25% size with -s postfix) and png format.

Here is how to get things done with image-batch : Let's create 100% size mockups for beginning:

image-batch -D path/to/mockups --name iphone% --resize 100% --save-as png --postfix l

Now our directory look like this:

iphone_6.png iphone_6_gold.jpg iphone_mockup.jpg iphone_6-l.png iphone_6_gold-l.png iphone_mockup-l.png mockup_htc_8.png galaxy-note-4-psd-mockup.png

Next we need 50% size mockups:

image-batch -D path/to/mockups --name iphone% --no-name iphone%-l --resize 50% --save-as png --postfix m

And 25% size:

image-batch -D path/to/mockups --name iphone% --no-name iphone%-l,iphone%-m --resize 25% --save-as png --postfix s --remove-original

Here is how our directory should look like on finish:

iphone_6-l.png iphone_6_gold-l.png iphone_mockup-l.png iphone_6-m.png iphone_6_gold-m.png iphone_mockup-m.png iphone_6-s.png iphone_6_gold-s.png iphone_mockup-s.png mockup_htc_8.png galaxy-note-4-psd-mockup.png

Installation

npm install -g image-batch

Usage

image-batch --help