white = 255, 255, 255
green = 0, 128, 0
root = Tk()
cv = Canvas(root, width=width, height=height, bg='white')
cv.pack()
image1 = Image.new('RGB', (width, height), white)
draw = ImageDraw.Draw(image1)
cv.create_line([0, center, width, center], fill='green')
draw.line([0, center, width, center], green)
filename = 'my_drawing.jpg'
image1.save(filename)
root.mainloop()
Как преобразовать содержимое холста в изображение?