What is the equivalent nodejs gm library https://github.com/aheckmann/gm command to this imagemagick cli command?
imagemagick cli command to layer several images on a transparent background:
convert -size 669x122 xc:none img1.jpg -geometry +223+0 -composite
img2.jpg -geometry +251+46 -composite
img3.png -geometry +283+46 -composite
img4.jpg -geometry +446+61 -composite
img5.jpg -geometry +223+61 -composite
img6.jpg -geometry +0+61 -composite
output.png
gm library command would be:?
const gm = require('gm').subClass({
imageMagick: true // im binaries are already installed on lambda functions
})
gm()
.out('-size 669x122 xc:none
img1.jpg -geometry +223+0 -composite
img2.jpg -geometry +251+46 -composite
img3.png -geometry +283+46 -composite
img4.jpg -geometry +446+61 -composite
img5.jpg -geometry +223+61 -composite
img6.jpg -geometry +0+61 -composite
output.png')
.write()
I'm new to nodejs and this will be running on an aws lambda function. Imagemagick binaries are preinstalled on lambda. In addition to my initial question, should I just use the exec() nodejs functionality to pass in this string or is there a benefit to using nodejs gm library?