4

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

2 Answers2

5

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

Manny
  • 369
  • 2
  • 7
  • The library works, however, its doc has an error, should be `import { joinImages } from 'join-images'` rather than `import joinImages from 'join-images'` – Alex G Jun 09 '23 at 03:28
2

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

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