Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Nodejs sharp package how to add two image into a single image?

I tried to combine two images into a single image using sharp package in NodeJS but i cant is there any ways to done this with sharp package

like image 768
Manickam venkatachalam Avatar asked Sep 11 '25 12:09

Manickam venkatachalam


2 Answers

Use another module instead of sharp to append images to one another

  • https://www.npmjs.com/package/join-images
like image 145
Manny Avatar answered Sep 13 '25 02:09

Manny


You can put an image in front to other with the next code:

sharp(pathToBaseImage)
  .composite([{ input: bufferFrontImage }])
  .sharpen()
  .toBuffer()
like image 42
Adrian Yama Yama Avatar answered Sep 13 '25 03:09

Adrian Yama Yama