zhangyuanwei / node-images

Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Nodejs
https://npmjs.org/package/images
MIT License
1.56k stars 205 forks source link

How to keep image1 and image2 side by side and save it in another image? #92

Closed DakshayaniChebrolu closed 5 years ago

DakshayaniChebrolu commented 8 years ago

Hi

I have two images ... image1, image2

I want to keep those two images in side by side and save it as a image3.

Please tell me the way to do using images.

DakshayaniChebrolu commented 8 years ago

Please any one reply to my query...

oxUnd commented 8 years ago

yeah, you can use .draw()

DakshayaniChebrolu commented 8 years ago

Thanks,but i am not getting my output properly

images("image2.png") .draw(images("image1.png"). 0, 0) .save("image3.jpg", { quality: 50 });

Can you please elaborate.

DakshayaniChebrolu commented 8 years ago

Please help me the way to proceed further

likang19870916 commented 7 years ago

why not use a bg.png which fill with #fffff; then images("bg.png").draw(images("image1.png"),0,0).draw(images("image2.png"),image1.width,0).save("image3.png");