In my little project I have a function that returns a list of points coordinates. Like this:
points = [(x1, y1), (x2, y2),...]
When I draw it on image, I get points on image but I want continious line. How can I get it? And how to draw interpolated lines on an image?
To draw lines, do the following:
import Image
import ImageDraw
im = Image.new('RGB',(500,500),(255,255,255))
draw = ImageDraw.Draw(im)
draw.line(points, fill=(255,0,0))
del draw
im.save('output.jpg')
Once you understand the above code you'll be able to use the answers in this question to draw antialiased lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With