Guest User

Untitled

a guest
Apr 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. from PIL import ImageFont, ImageDraw, Image
  2.  
  3. image = Image.open("test.png") #ファイルtext.pngの画像を開く
  4. draw = ImageDraw.Draw(image) #fontを書き込むためのdrawを取得
  5. font = ImageFont.truetype("WRITE_HERE.ttf", 15) #ここに表示したいttfを表示する
  6. draw.text((100, 100), "ABCDE", font=font) #x:100,y:100のところにABCDEを上記fontで表示
Add Comment
Please, Sign In to add comment