PIL and transparency in IE

Discussion in 'Python' started by Marek, Jun 26, 2003.

  1. Marek

    Marek Guest

    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??
     
    Marek, Jun 26, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jean-Baptiste Cazier

    Transparency with PIL and paste ?

    jean-Baptiste Cazier, Jul 23, 2003, in forum: Python
    Replies:
    0
    Views:
    661
    jean-Baptiste Cazier
    Jul 23, 2003
  2. Robin Becker

    PIL & TIFF transparency?

    Robin Becker, Jul 30, 2003, in forum: Python
    Replies:
    2
    Views:
    754
    Robin Becker
    Jul 31, 2003
  3. Gustavo Campanelli

    Newbie : Gif transparency with Pil problem.

    Gustavo Campanelli, Dec 15, 2003, in forum: Python
    Replies:
    2
    Views:
    352
    Gustavo Campanelli
    Dec 16, 2003
  4. Caleb Hattingh
    Replies:
    2
    Views:
    2,160
    Caleb Hattingh
    Dec 1, 2004
  5. Durand
    Replies:
    0
    Views:
    1,058
    Durand
    Jul 10, 2008
Loading...

Share This Page