ImageFond的使用

1 from PIL import Image,ImageFont,ImageDraw
2 img = Image.open(r'C:\Users\87823\Desktop\tree.png')
3 print(img.size)
4 draw_obj = ImageDraw.Draw(img)
5 #font = ImageFont.load_default() # 加载一种默认的字体
6 font = ImageFont.truetype('SIMYOU.TTF',64)
7 draw_obj.text((150,400),'monster',font = font,fill='red')
8 img.show()

 

posted @ 2020-05-19 18:23  小他_W  阅读(112)  评论(0编辑  收藏  举报