[Image-SIG] imagedraw

WANG Yu yu.wang at gsf.de
Fri Sep 19 12:12:17 EDT 2003


Hello, I tried to run the example from the documentation of Imagedraw, 
but got the following errors:

moco ~/python>imagetest.py
(370, 278)
Traceback (most recent call last):
   File "imagetest.py", line 12, in ?
     draw.line((0, 0), im.size)
   File 
"/home/users/wang/JUNK/Python-2.3/lib/python2.3/site-packages/PIL/ImageDraw.py", 
line 183, in line
     ink, fill = self._getink(fill)
   File 
"/home/users/wang/JUNK/Python-2.3/lib/python2.3/site-packages/PIL/ImageDraw.py", 
line 131, in _getink
     ink = self.draw.draw_ink(ink, self.mode)
TypeError: an integer is required


The code looks like this:


#! /Python-2.3/bin/python2.3

import Image, ImageDraw

im = Image.open("/junk/image570735x.jpg")

# draw a grey cross over the image
draw = ImageDraw.ImageDraw(im)
draw.setink(128)
draw.line((0, 0), im.size)

draw.line((0, im.size[1]), (im.size[0], 0))
del draw

im.show()

Can anybody tell me what went wrong? Thank you very much in advance.

Yu



-- 
Ir. Yu Wang
Institute for Bioinformatics
GSF - German Research Center for Environment and Health
Ingolstaedter Landstr. 1
D-85764 Neuherberg, GERMANY
_______________________________________________________

http://mips.gsf.de              Email:yu.wang at gsf.de
Tel: (+49) 89/3187-2627         Fax: (+49) 89/3187-3585
_______________________________________________________
"What Fools These Mortals Be," W. Shakespeare




More information about the Image-SIG mailing list