I’m trying to create an image in PIL, what I want to do is draw two polygons that overlap … how do you set a shapes fill opacity ? The effect that I’m trying to achieve
is like http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/
http://effbot.org/zone/pythondoc-aggdraw.htm
I will try to make a follow-up post demonstrating some ways to draw polygons with opacity in Python shortly.
]]>from PIL import Image,ImageDraw
import aggdraw
img=Image.new(’RGBA’,(200,200),(255,255,255))
d = aggdraw.Draw(img)
p = aggdraw.Pen(”red”, 0.5,50)
b = aggdraw.Brush(”red”)
d.polygon([60,160,90,60,190,190,60,190],p,b)
b = aggdraw.Brush(”yellow”,50)
d.polygon([0,0,90,60,90,190,0,90],b)
d.line((0, 0, 500, 500), p)
d.flush()
img.save(’test.png’,'PNG’)