chris 746868d720 Add 'main-site/' from commit '5cefb4d1618bc54ae0e86830421a8c911900302c'
git-subtree-dir: main-site
git-subtree-mainline: 4d1daa39101c0a85ca6d916f1c31139faf39632a
git-subtree-split: 5cefb4d1618bc54ae0e86830421a8c911900302c
2026-04-13 19:22:17 -04:00

30 lines
778 B
JavaScript

// composite
/**
* Composite images together using the `composite` command in graphicsmagick.
*
* gm('/path/to/image.jpg')
* .composite('/path/to/second_image.jpg')
* .geometry('+100+150')
* .write('/path/to/composite.png', function(err) {
* if(!err) console.log("Written composite image.");
* });
*
* @param {String} other Path to the image that contains the changes.
* @param {String} [mask] Path to the image with opacity informtion. Grayscale.
*/
module.exports = exports = function(proto) {
proto.composite = function(other, mask) {
this.in(other);
// If the mask is defined, add it to the output.
if(typeof mask !== "undefined")
this.out(mask);
this.subCommand("composite");
return this;
}
}