I have a set of (x,y) coordinates rasterized from a sketch:
x = [167, 109, 80, 69, 58, 31]
y = [140, 194, 227, 232, 229, 229]
I want to recreate that sketch and save it as an image. At the moment I am using PIL draw line function, like this:
from PIL import Image, ImageDraw
im = Image.new('L', (256, 256), 255)
draw = ImageDraw.Draw(im)
for i in range(len(x)-1):
draw.line((x[i],y[i], x[i+1], y[i+1]),fill=0,width=2)
im.save('test.png')
I wonder if there is a faster way to do it. The (x,y) points are in drawing order, so maybe using Image.putdata() could help?
