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

Upvotes: 4

Views: 4847

Answers (2)

Adrian Yama Yama
Adrian Yama Yama

Reputation: 96

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

sharp(pathToBaseImage)
  .composite([{ input: bufferFrontImage }])
  .sharpen()
  .toBuffer()

Upvotes: 2

Manny
Manny

Reputation: 389

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

Upvotes: 5

Related Questions