I need to stitch multiple pngs into a long png, and I believe I can use Jimp's blit method:
// blit the image with another Jimp image at x, y, optionally cropped.
image.blit( src, x, y, [srcx, srcy, srcw, srch] );
My question is, how do I loop along all the pngs and make the current png attach to the end of the previous one? For example, they are all in a same folder with file names like img-1, img-2 ... img-10. And their sizes are not necessarily the same. This is what I have in mind, any suggestions would be greatly appreciated!
// This is dummy code
const bg = white_background
bg.width = Math.max(img-1...img-10 width)
bg.height = sum(img-1...img-10 height)
for (let i=0;i<imgs.length;i++) {
if(i=0) bg.blit(img, 0, 0)
else bg.blit(img, imgs[i-1].width, imgs[i-1].height)
}