from PIL import Image # 输入已经去除背景的图像 im = Image.open('./src/assets/logo.png') x, y = im.size p = Image.new('RGBA', im.size, (255, 255, 255)) p.paste(im, (0, 0, x, y), im) p.save('./src/assets/logo2.png')