make-img-divisible-by-n
v1.0.0
Published
Takes an image and expands it to be divisible by any integer
Downloads
2
Maintainers
Readme
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');
});