make-img-divisible-by-n

1.0.0 • Public • Published

Make Image Divisible By N

Takes an image and expands its width and heigt to be divisible by the provided integer.

Works with ndarray based images only.

Install

npm install make-img-divisible-by-n --save

Usage

var getPixels = require('get-pixels');
var savePixels = require('save-pixels');
var fs = require('fs');

var makeImageDivisibleByN = require('posterize');

getPixels('./path-to-image.jpg', function(err, inImage) {
  var outImg = makeImageDivisibleByN(inImage, 10);
  savePixels(outImg, 'jpg').pipe(fs.createWriteStream('./new-image.jpg');
});

Package Sidebar

Install

npm i make-img-divisible-by-n

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mcwhittemore