PIL and transparency in IE

M

Marek

Hi,
I have big problem when i try generate a PNG image with transparent
background. When i open a source PNG file with tranasparent background
everything is going well but not in IE. I know that is a bug in IE.
But i can make PNG with transparent in PHP or graphic program it runs
well in IE (execly no with transparent background but with transaprent
object). But when I open it
in Python the Python generates error:

File "C:\WINDOWS\Pulpit\python\piatek\googlepl.py", line 33, in ?
im.save(name, "PNG")
File "C:\PYTHON22\Lib\site-packages\PIL\Image.py", line 1125, in
save
self.load()
File "C:\PYTHON22\Lib\site-packages\PIL\ImageFile.py", line 114, in
load
Image.Image.load(self)
File "C:\PYTHON22\Lib\site-packages\PIL\Image.py", line 507, in load
apply(self.im.putpalette, self.palette.getdata())
File "C:\PYTHON22\Lib\site-packages\PIL\ImagePalette.py", line 39,
in
getdata
return self.mode + ";L", self.tostring()
File "C:\PYTHON22\Lib\site-packages\PIL\ImagePalette.py", line 45,
in
tostring
return array.array("B", self.palette).tostring()
TypeError: an integer is required

this is my cod:

im = Image.open("przez.png")
draw = ImageDraw.Draw(im)
font = ImageFont.truetype(FONTFILE, 56)
draw.text((450, 320), title, font=font, fill="black")
im.save(name, "PNG")

Can someone help??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top