[Image-SIG] ImageDraw not working ( for me )

phil wilshire philwil@on-ramp.ior.com
Tue, 31 Aug 1999 06:21:29 -0700


HI,
I am trying to replace my GD python package to 
fend off the gif patent problem.

I am looking at a simple example almost out of the book.


import Image, ImageDraw, ImagePalette

#im = Image.new('P',(300,200),100)
im = Image.open("lena.jpg")
draw = ImageDraw.Draw(im)
pal = ImagePalette.ImagePalette
draw.setink(128)

#print draw.ink
#print draw.im


draw.line((0,0),im.size)


I get the following error.

Traceback (innermost last):
  File "t.py", line 14, in ?
    draw.line((0,0),im.size)
  File "/usr/local/lib/python1.5/site-packages/PIL/ImageDraw.py", line
107, in line
    ink, fill = self._getink(fill)
  File "/usr/local/lib/python1.5/site-packages/PIL/ImageDraw.py", line
73, in _getink
    ink = self.im.draw_ink(ink)
TypeError: illegal argument type for built-in operation

I have started to trace through the package but I wondered if this
problem had 
already been solved.

Please reply via e-mail.

Many thanks
   Phil Wilshire