Pil-Libary---write text into an image file

Pete Shinners pete at shinners.org
Wed Nov 21 09:43:02 EST 2001


stephan wrote:

> Hi there, is it possible to open a image file, write text inside and save it
> in an image file iI can display in common Browsers.
> Do I have to use the PIL-Libary?
> Please help, we are desperate...
> And Tommy is suffering...

well, it may be a bit overkill if you are just doing images on fonts, 
but you could use the pygame library to this effect (and save poor 
tommy). it can only save BMP files, if that is a concern?
http:/www.pygame.org

see attachment for the code to do it. (90% of the code is reading the 
commandline args, the other 4 lines to the work) :]
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rendertext.py
URL: <http://mail.python.org/pipermail/python-list/attachments/20011121/b7eb4dea/attachment.ksh>


More information about the Python-list mailing list