有時候想畫一下kuso 的圖片,卡片,或是名片的應用,可以用的上
,拿來作 Captcha 的功能時,也可以用上,當然不用一定要中文的,在加上一些 PIL 的濾鏡特效,及背景即可,這裡用的範例是firefly前輩的美美中文字型

#!/usr/bin/env python
# -- encoding: utf-8 --

import Image, ImageDraw, ImageFont
font = ImageFont.truetype(’/usr/share/fonts/truetype/fireflysung.ttf’,36)
im = Image.new( “RGB”, (200,200))
draw = ImageDraw.Draw( im )
draw.text( (40,40), unicode(“寶貝”), font=font )
im.save(“test.jpeg”)

請參考
http://tech.seety.org/python/python_imaging.html