pip install pillow
from PIL import Image
if __name__ == '__main__':
# 创建
image = Image.new(mode='RGBA', size=(500, 500), color=(0, 0, 0, 0))
# 展示
image.show()
# 保存
image.save('a.png')
提示:报错的话,先卸载pillow,在重新安装pillow。
pip install pillow
from PIL import Image
if __name__ == '__main__':
# 创建
image = Image.new(mode='RGBA', size=(500, 500), color=(0, 0, 0, 0))
# 展示
image.show()
# 保存
image.save('a.png')
提示:报错的话,先卸载pillow,在重新安装pillow。