Python Imaging Library - Text rendering

前端 未结 6 938
终归单人心
终归单人心 2020-11-28 03:49

I\'m trying to render some text using PIL, but the result that comes out is, frankly, crap.

For example, here\'s some text I wrote in Photoshop:

6条回答
  •  粉色の甜心
    2020-11-28 04:06

    In python3 there is an option for aliased fonts. I couldn't find this answer anywhere, hopefully it helps someone like me who found this question on google and had to dig a long time to find the answer.

    draw = ImageDraw.Draw(img)
            draw.fontmode = "L"
    

    Mentioned in the docs here

提交回复
热议问题