[Image-SIG] mixing vector and raster drawing with aggdraw
jmikulasek at gmail.com
Wed Aug 9 14:57:14 CEST 2006
I am using aggdraw to implement a simple map viewer. I get a rendered
background map from Mapserver/Mapscript and then pass it to aggdraw.Draw
through a PIL.Image to draw a position (and shape) of some objects (trees,
benches, ...). Such an object might be drawn as a circle or polygon which is
fine with Draw class, however some objects need to be drawn as small
bitmaps. It seems to me that Draw class does not support pasting bitmaps
and I have to flush previously drawn objects to the underlying PIL.Image,
paste the bitmap using Image.paste and then create a new Draw instance.
If I understand it correctly this involves a lot of memory copying.
Is there some other way for me to mix the vector and raster drawing with
aggdraw? Or is that possible with aggdraw without the switching between Draw
I know that I might minimize the swithing with some clever preprocessing
but it would make the code more complicated and I would like to do it
only if I do not find another way.
PS.: aggdraw is a really nice tool, thank you for it
More information about the Image-SIG