1. 首页
  2. 数据库
  3. 其它
  4. PIL(pillow)简单使用:新建画布、添加文字、画矩形、裁剪、粘贴

PIL(pillow)简单使用:新建画布、添加文字、画矩形、裁剪、粘贴

上传者: 2021-01-15 16:25:11上传 PDF文件 95.69KB 热度 24次
安装依赖 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
下载地址
用户评论