Python Imaging Library - Text rendering

前端 未结 6 939
终归单人心
终归单人心 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:10

    I've never used PIL, but a quick review of the documentation for the Draw method indicates that PIL provides a way to render simple graphics. Photoshop provides a way to render complex graphics. To get anywhere close to Photoshop-like results requires, at a minimum, font hinting and anti-aliasing. PIL's documentation doesn't even hint at having such capabilities. You may want to look at using an external tool that might do a better job of rendering text on images. For example, ImageMagick (you'll want to use the 8-bit version, which handles standard 24-bit RGB). You can find some text drawing samples here: http://www.imagemagick.org/Usage/draw/

提交回复
热议问题