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()
正是江南好风景