1.0.0 • Published 7 years ago

image-shrinker v1.0.0

Weekly downloads
2
License
GPL-2.0
Repository
github
Last release
7 years ago

Image Shrinker

Module to convert images in directory to different size

The purpose of this module is to convert images in one directory (hence input directory) into another size and into an directory (hence output directory).

It can be used as an CLI application or as an module in another application.

Install

// for in programmatic usage
npm install --save image-shrinker

// or for cli usage
npm install -g image-shrinker

Programmatic

var shrinker = require('image-shrinker');

shrinker.convert(input_dir, dimension, output_dir);

CLI

$ image-shrinker convert <input-dir> <dimension> [<output_dir>]

Parameters

The possible parameters are as follows.

  • input_dir - input directory
  • dimension - dimension for converted images (ffmpeg compatible)
  • output_dir - output directory OPTIONAL (default: same as input_dir)

Size examples

This is just an excerpt of the possibilities of the ffmpeg size declaration you can use. More info can be found here.

  • 320x? - fixed width, calc height
  • ?x240 - fixed height, calc width
  • 50% - percentage resize
  • 320x240 - fixed width & height