merge2images

1.1.2 • Public • Published

Merge2Images

Merge images using the api of Images

Author

Instalation

$ npm install merge2images

API

const images = require('merge2images');

//merge big image with small image and save at out image
images.merge(bigImg, smallImg, outImg);

//merge big image with small image at coordinates (x,y) and save at out image
images.mergeWithCoordinates(bigImg, smallImg, outImg, x, y);

//merge big image with small image, save at out image and auto scaling with number of width pixel
images.mergeWithAutoScaling(bigImg, size1, smallImg, size2, outImg);

//merge big image with small image, save at out image and manual scaling with number of width and height pixels
images.mergeWithManualScaling(bigImg, width1, height1, smallImg, width2, height2, outImg);

//merge big image with small image, save at out image, manual scaling and set coordinates(x,y)
images.mergeWithAll(bigImg, width1, height1, smallImg, width2, height2, outImg, x, y);

//merge big image with small image, save at out image, manual scaling and set small image at the center of the screen
images.mergeWithAllCenter(bigImg, width1, height1, smallImg, width2, height2, outImg);

Example

const images = require('merge2images');

const bigImage = '/home/compyrat/server/public/images/bigImage.png';
const smallImage = '/home/compyrat/server/public/images/smallImage.png';
const outImage = '/home/compyrat/server/public/images/output/output.png';

exports.index = function(req, res){
	images.mergeWithAllCenter(bigImage, 500, 300,
							smallImage, 400, 100,
							outImage);
	next();  
};

Readme

Keywords

Package Sidebar

Install

npm i merge2images

Weekly Downloads

1

Version

1.1.2

License

ISC

Last publish

Collaborators

  • compyrat