PIL(pillow)简单使用:新建画布、添加文字、画矩形、裁剪、粘贴
安装依赖 pip install pillow 1、新建一张300*300的白色画布 # -*- coding: utf-8 -*- from PIL import Image # 参数:模式、大小、颜色 image = Image.new(mode=RGB, size=(300, 300), color=white) image.save(1.png) 图片: 2、画布上加一些文字 # -*- coding: utf-8 -*- from PIL import Image, ImageDraw, ImageFont # 参数:模式、大小、颜色 image = Image.n
下载地址
用户评论