【问题标题】:In Nodejs sharp package how to add two image into a single image?在 Nodejs 锐化包中如何将两个图像添加到一个图像中?
【发布时间】:2021-09-26 10:37:50
【问题描述】:

我尝试在 NodeJS 中使用Sharp 包将两个图像组合成一个图像,但我无法使用Sharp 包来完成此操作

【问题讨论】:

    标签: node.js append sharp


    【解决方案1】:

    使用另一个模块而不是 sharp 将图像附加到另一个

    【讨论】:

      【解决方案2】:

      您可以使用以下代码将图像放在其他图像的前面:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-06-26
        • 2011-10-22
        • 2013-11-22
        • 1970-01-01
        • 1970-01-01
        • 2013-08-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多