http://livingcode.org/2008/03/31/saving-png-from-pygame <![CDATA[Comments on: Saving PNG from PyGame]]> Dethe WordPress 2008-11-24T20:05:13Z http://livingcode.org/2008/03/31/saving-png-from-pygame/comment-page-1#comment-30 2008-11-24T12:05:13Z <![CDATA[Comment by: Monday: saving images from Python … « Jon’s PhD Journal]]> http://jdephd.wordpress.com/2008/11/24/monday-saving-images-from-python/ [...] Monday: saving images from Python … Filed under: Notes — JDE @ 7:53 pm http://livingcode.org/2008/saving-png-from-pygame#respond [...]

]]>
http://livingcode.org/2008/03/31/saving-png-from-pygame/comment-page-1#comment-31 2008-12-11T07:03:46Z <![CDATA[Comment by: atm0s1]]> hi,

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://livingcode.org/2008/03/31/saving-png-from-pygame/comment-page-1#comment-32 2008-12-11T09:12:22Z <![CDATA[Comment by: delza]]> http://livingcode.org/ Hi Roger, I enjoyed your post on generating the Mona Lisa using polygons. Looking at the PIL documentation, I don’t see any way to draw polygons using opacity. There is an optional PIL library, aggdraw, which supports opacity (alpha):

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.

]]>
http://livingcode.org/2008/03/31/saving-png-from-pygame/comment-page-1#comment-33 2008-12-11T11:10:16Z <![CDATA[Comment by: atm0s1]]> figured it out thanks to your aggdraw tip

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’)

]]>
http://livingcode.org/2008/03/31/saving-png-from-pygame/comment-page-1#comment-34 2008-12-11T11:17:38Z <![CDATA[Comment by: delza]]> http://livingcode.org/ Cool! I’m looking forward to seeing how you wrote the genetic algorithm for Mona Lisa. Glad if I could help in some small way.

]]>
http://livingcode.org/2008/03/31/saving-png-from-pygame/comment-page-1#comment-35 2008-12-11T11:34:46Z <![CDATA[Comment by: atm0s1]]> i’ll give it a shot and post back the results ;-)

]]>
http://livingcode.org/2008/03/31/saving-png-from-pygame/comment-page-1#comment-39 2009-01-03T11:54:39Z <![CDATA[Comment by: Living Code » Blog Archive » Drawing with opacity]]> http://livingcode.org/2008/drawing-with-opacity [...] is something of a followup to earlier posts Drawing Hexmaps and Saving PNG from PyGame. A recent comment from Roger Aisling on the second of those posts asked about drawing with opacity [...]

]]>