0

I'm using watermarkjs npm i watermarkjs trying to add watermark by placing logo to an image. I just want to increase or decrease watermark logo size. Do we have options for width size in watermark.js .

var options1 = {
  init: function(img) {
    img.crossOrigin = 'anonymous';
  },
  type: 'image/jpeg',
};

return await watermark([imageFile, logo], options1)
  .blob(watermark.image.atPos((target, mark) => (target.width - mark.width) / 2, (target, metrics, ctx) => {
    return 10;
  }, waterMarkTextOpacity))
Rory McCrossan
  • 319,460
  • 37
  • 290
  • 318
  • 1
    According to the [documentation](https://brianium.github.io/watermarkjs/docs.html#image) the images are drawn using canvasses which can be accessed from the arguments in the function. You should be able to resize those canvasses as normal: https://stackoverflow.com/a/9251555/519413 – Rory McCrossan Jul 07 '21 at 11:57
  • Thanks for the Comments. Its Helpful – Prashanth_Alpha Jul 07 '21 at 15:14

0 Answers0