2948 explained code solutions for 75 technologies


python-pillowHow to draw an arc


from PIL import Image, ImageDraw
  
im = Image.new("RGB", (400, 300))  
dr = ImageDraw.Draw(im)
dr.arc([(50,50), (350,250)], start = 20, end = 230, fill ="white")
im.show()ctrl + c
PIL

import Pillow package modules

Image.new

create new PIL image object

ImageDraw.Draw

create drawing object

.arc(

draws an arc

(50,50), (350,250)

coordinates of an arc bounding rectangle

start = 20

starting angle (starts from 3pm)

end = 230

ending angle

.show()

displays resulting image