I'd like to make mosaic images using gm() and NodeJS but it seems not working with my code, I think that the problem is due to the original size of the image (600 * 200), my template is smaller than the images...
My result should be something like this :
My code :
gm()
.in('-page', '+0+0')
.in('./public/images/instafilm.jpg') // my empty template, white and 142 * 500
.in('-page', '+10+10')
.resize(122, 122, '!')
.in('./public/images/firstimage.jpg') // 600 * 600
.in('-page', '+10+132')
.resize(122, 122, '!')
.in('./public/images/secondimage.jpg') // 600 * 600
.in('-page', '+10+164')
.resize(122, 122, '!')
.in('./public/images/thirdimage.jpg') // 600 * 600
.in('-page', '+10+296')
.resize(122, 122, '!')
.in('./public/images/fourthimage.jpg') // 600 * 600
.mosaic()
.minify()
.write(newFileName, function (err) {
if (!err) console.log('done');
if (err) console.log(err);
callback();
});