【问题标题】:How to insert small image into corner of a photo with Python Pillow/Image?如何使用 Python Pillow/Image 将小图像插入照片的角落?
【发布时间】:2016-05-20 01:00:09
【问题描述】:

我正在尝试使用 Pillow 库在图像的右下角插入一个 252 x 40 像素的小图像。

目前,这就是我尝试基于使用 Pillow/Image 覆盖图像的一般方法的方法:

back = Image.open("images/background.png")
width, height = back.size
image1 = Image.open("images/picture.png")
width1, height1 = image1.size
image1 = image1.convert("RGBA")
back.paste(image, (width - width1, width - height1), image1)

这样做无法覆盖图像。我应该使用任何提示或其他库来完成此操作?

【问题讨论】:

    标签: python image photo pillow


    【解决方案1】:

    想通了。

    back.paste(image1, (width - width1, height - height1), image2)

    【讨论】:

      猜你喜欢
      • 2011-04-06
      • 1970-01-01
      • 2014-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-03
      相关资源
      最近更新 更多