源代码
# -*- coding: utf-8 -*-
from PIL import Image
'''图片合成
'''
def mergePictureLXJ():commonIcon= Image.open("icon.png")markIcon = Image.open("领现金.png")markLayer = Image.new('RGBA', commonIcon.size, (0, 0, 0, 0))markLayer.paste(markIcon, (0, 0))out = Image.composite(markLayer, commonIcon, markLayer)out.save("领现金-输出.png", quality=95, subsampling=0)print ('领现金 合成成功')
if __name__== '__main__':mergePictureLXJ()