corrade-nucleus-nucleons – Blame information for rev 36
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
36 | office | 1 | // composite |
2 | |||
3 | /** |
||
4 | * Composite images together using the `composite` command in graphicsmagick. |
||
5 | * |
||
6 | * gm('/path/to/image.jpg') |
||
7 | * .composite('/path/to/second_image.jpg') |
||
8 | * .geometry('+100+150') |
||
9 | * .write('/path/to/composite.png', function(err) { |
||
10 | * if(!err) console.log("Written composite image."); |
||
11 | * }); |
||
12 | * |
||
13 | * @param {String} other Path to the image that contains the changes. |
||
14 | * @param {String} [mask] Path to the image with opacity informtion. Grayscale. |
||
15 | */ |
||
16 | |||
17 | module.exports = exports = function(proto) { |
||
18 | proto.composite = function(other, mask) { |
||
19 | this.in(other); |
||
20 | |||
21 | // If the mask is defined, add it to the output. |
||
22 | if(typeof mask !== "undefined") |
||
23 | this.out(mask); |
||
24 | |||
25 | this.subCommand("composite"); |
||
26 | |||
27 | return this; |
||
28 | } |
||
29 | } |