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