[Image-SIG] Does the experimental RGBA-on-RGB drawing mode work?

Uttam M. Narsu unarsu at gmail.com
Wed Dec 10 19:32:00 CET 2008


Apologies if this is a dup, since I wasn't subscribed to the list.
I'm trying to draw using the experimental RGBA-on-RGB interface. I
can't seem to get it to work. My code is below:

from PIL import Image, ImageDraw

ml = Image.new("RGBA", (200,200))
D = ImageDraw.Draw(ml, "RGBA")

red = (0xff, 0x00, 0x00, 0xA9)
green = (0x00, 0xbf, 0x00, 0x83)

D.polygon([(40, 40), (40, 100), (100, 100), (100, 40)], fill=red)
D.polygon([(20, 20), (20, 80), (80, 80), (80, 20)], fill=green)
ml.save("test.png", "PNG")

Results in the attached image. The red polygon doesn't show through
beneath the green one.

I'd appreciate any pointers on this. It seems fairly simple.

I'm using python/py25-pil 1.1.6 installed through macports on leopard. Thanks.

-
uman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 2785 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20081210/594afa98/attachment.png>


More information about the Image-SIG mailing list