【发布时间】:2019-09-15 21:19:31
【问题描述】:
我粘贴了一张带有透明像素的图像,但在最终图像中它们是黑色的
img = Image.new('RGBA', (100, 100), "white")
arbol16 = Image.open("arbol16.png")
img.paste(arbol16,( 0, 0, 16, 16))
img.show()
arbol16.png图片文件:
【问题讨论】:
-
由于图像格式的工作方式,即使是 100% 透明像素也有关联的颜色,即使在渲染时不使用它也是如此。很多时候,查看图像的方法不能很好地处理 alpha,因此显示相关的颜色。不知道这是否是你在这里打的。
标签: python python-imaging-library transparency