PIL Issue, OSError: cannot open resource

前端 未结 7 1792
野的像风
野的像风 2020-12-31 04:12

I\'m attempting to write a program that places text onto an image, I\'m trying to get my head round PIL and have run into the error: OSError: cannot open resource. This is m

7条回答
  •  一生所求
    2020-12-31 04:17

    from PIL import Image,ImageDraw,ImageFontim = Image.open("mak.png")
    font_type = ImageFont.truetype("arial.ttf", 18)
    draw = ImageDraw.Draw(im)
    draw.text(xy=(120, 120), text= "download the font that you wanna use", fill =(255,69,0), font = font_type)
    im.show()
    

    Its "arial.ttf" not "Arial.ttf"

    Here is the link to download arial.ttf font.

提交回复
热议问题