Dmitry Vasiliev wrote:

Morten W. Petersen wrote:

Hi all,

I'm trying to create a script that will superimpose text on an image. I didn't find any great examples out there on how this can be done (I presume using PIL is necessary), do you know of any examples?


You can do it like this:

>>> from PIL import Image, ImageDraw
>>> image = Image.new("L", (100, 50))
>>> draw = ImageDraw.Draw(image)
>>> draw.text((10, 10), "Hello, World!", fill=0xff)
>>> image.show()

See also ImageFont module.


Thanks, as I mentioned earlier, that helped. I have a new problem now however;
the image I'm drawing on is a transparent PNG, and any text that's drawn is
also transparent, i.e. it just 'cuts out' pieces of the image instead of drawing
colored text.. how do I fix that?


PS:  I'm not on the list so I would appreciate a CC.

--
Regards,

Morten

Tlf:  +47 45 44 00 69
Blog: http://www.blogologue.com

begin:vcard
fn:Morten Petersen
n:Petersen;Morten
org:Nidelven IT
adr:;;Postboks 923;Trondheim;;7409;Norway
email;internet:[EMAIL PROTECTED]
title:Project Manager
tel;work:+47 45 44 00 69
tel;cell:+47 45 44 00 69
x-mozilla-html:FALSE
url:http://www.nidelven-it.no
version:2.1
end:vcard

_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to