drever at in.tum.de
Tue Jan 22 10:28:42 CET 2008
thank you, that helped! I didn't notice the flush statement.
Coen van der Kamp wrote:
> drever wrote:
>> I'm using PIL to load and save images. To draw images I use
>> ImageDraw, but I am not content with the drawing quality. aggdraw
>> uses agg which is a high quality drawing engine. I could not install
>> it, so is there an alternative or can anybody help?
>> I tried to install it on ubuntu 7.10 with python 2.5.1. After
>> building the package the ./selftest.py crashed with a segfault.
>> When I import aggdraw to python, I can use it with Image without
>> crashes, but I don't see anything on the Image.
>> Thanks for any advice!
>> Image-SIG maillist - Image-SIG at python.org
> Hello Drever,
> You don't have errors when importing aggdraw and Image? Than this has
> to work:
> import aggdraw, Image
> im = Image.new("RGB", (100, 100), ("white"))
> draw = aggdraw.Draw(im)
> pen = aggdraw.Pen('black', width=5, opacity=255)
> draw.ellipse((10,10,90,90), pen)
> draw.flush() # Without the flush you'll get an empty image!
> # im.show() # Has compression
> im.save("/path/to/your/folder/test.png", "png") # Clean aggdraw image
> Hope it helps!
More information about the Image-SIG