1. 首页
  2. 数据库
  3. 其它
  4. python批量在图片指定位置添加文字

python批量在图片指定位置添加文字

上传者: 2020-12-23 02:22:09上传 PDF文件 23.38KB 热度 76次
批量在图片指定位置添加文字python # 导入PIL模块 from PIL import Image, ImageDraw, ImageFont, ImageFilter zt = r"C:/Windows/Fonts/simhei.ttf" # 指定字体 def tianzi(pic, site, txt, path): # 打开初始文件 image = Image.open(pic) # print('原图长宽:', image.size) font = ImageFont.truetype(zt, 50) # 创建Draw对象: d
下载地址
用户评论