Thursday, 21 January 2021

Draw dotted or dashed rectangle from PIL

I want to draw a dotted rectangle using PIL.

I know I can draw 4 different dotted lines to make it look like a rectangle with this:

for x in range(0, Width_of_image, 5):
    d.line([(x, 30), (x + 2, 30)],fill ="black", width =2) 

But is there any way to draw a rectangle using draw.rectangle, i.e., without drawing 4 different line?



from Draw dotted or dashed rectangle from PIL

No comments:

Post a Comment