PIL Example

smibr at my-deja.com smibr at my-deja.com
Tue Jan 23 23:45:57 EST 2001


Current code looks like this:

#!/usr/bin/env python
# example: Draw a Grey Cross Over an Image

import Image, ImageDraw

print Image.VERSION

im = Image.open("lena.ppm")

draw = ImageDraw.Draw(im)
draw.line((0,0),im.size, fill=128)
draw.line((0,im.size[1]),(im.size[0],0), fill=128)
del draw

# write to stdout
im.save('TEST.png', "PNG")

This is the output:
[smibr at localhost Images]$ imagetest.py
1.0.1
Traceback (most recent call last):
  File "/home/smibr/bin/imagetest.py", line 11, in ?
    draw.line((0,0),im.size, fill=128)
TypeError: keyword parameter redefined: fill
[smibr at localhost Images]$ imagetest.py
1.0.1
Traceback (most recent call last):
  File "/home/smibr/bin/imagetest.py", line 11, in ?
    draw.line((0,0),im.size, fill=128)
TypeError: keyword parameter redefined: fill
[smibr at localhost Images]$

I guess upgrading would help. When I run it on the Windows 95 box at
work it runs just fine. I still wonder about the traceback though.


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list