PIL - setting the width of lines in ImageDraw

Max M maxm at mxm.dk
Mon Sep 13 16:00:15 EDT 2004


I am using PIL to generate som graphs, like:

draw = ImageDraw.Draw(im)
for graph in self.graphs:
     polygon = graph.getPolygon()
     draw.polygon(polygon, outline=graph.color)
del draw

But the linewidth of my polygon is only one pixel wide. Is there any way 
to set it to something else?

(How nice it would be to have css compatible parameters on polygons, 
like: draw.polygon(polygon, border="1px solid gray"))

I have read the docs, and browsed the source. But me being a lowly 
Windows developer I stopped at _imaging.py module, which the ImageDraw 
module apparantly use to do the actual drawing.


regards Max M



More information about the Python-list mailing list