Reputation: 471
I want to combine several images in a grid. How can I accomplish the following without knowing the image paths beforehand?
gm('/path/to/image.jpg')
.montage('/path/to/second_image.jpg')
.montage('/path/to/third_image.jpg')
.geometry('+100+150')
.write('/path/to/montage.png', function(err) {
if(!err) console.log("Written montage image.");
});
Lets say the image pathes are available in an array:
paths=['/path/to/image.jpg', '/path/to/second_image.jpg', '/path/to/third_image.jpg');
Upvotes: 0
Views: 1044
Reputation:
hm. I did not use much that module, i d do,
var g = gm('/path/to/image.jpg');
paths.forEach(function(p){
g.montage(p);
});
g.geometry('+100+150')
.write('/path/to/montage.png', function(err) {
if(!err) console.log("Written montage image.");
});
no ?
Upvotes: 2