遮罩混合

1 from PIL import Image
2 img1 = Image.open(r'C:\Users\87823\Desktop\tree.png')
3 img2 = Image.open(r'C:\Users\87823\Desktop\gold.png')
4 img2 = img2.resize(img1.size) #尺寸要相同
5 r,g,b = img1.split() # 分隔通道
6 Image.composite(img1,img2,b).show()

 

 

posted @ 2020-05-18 12:55  小他_W  阅读(179)  评论(0编辑  收藏  举报