Answer the question
In order to leave comments, you need to log in
How to set line width when drawing primitives?
Hello, I use pillow, I draw some kind of primitive, for example, an ellipse
import Image, ImageDraw
image = Image.new('RGBA', (200, 200))
draw = ImageDraw.Draw(image)
draw.ellipse((20, 180, 180, 20), fill = 'blue', outline ='blue')
Answer the question
In order to leave comments, you need to log in
As I understand it, by regular means in any way.
You can draw two ellipses with a 1 pixel offset:
from PIL import Image, ImageDraw
image = Image.new('RGBA', (200, 200))
draw = ImageDraw.Draw(image)
draw.ellipse((20, 25, 100, 150), fill = None, outline ='blue')
draw.ellipse((19, 24, 101, 151), fill = None, outline ='blue')
del draw
image.show("test.png", "PNG")
draw.line((0, 0) + image.size, fill=128, width=5)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question