PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The
ImageDraw module provide simple 2D graphics for Image objects. You can use this module to create new images, annotate or retouch existing images, and to generate graphics on the fly for web use.
ImageDraw.Draw.line() Draws a line between the coordinates in the xy list.
Syntax: PIL.ImageDraw.Draw.line(xy, fill=None, width=0)
xy – Sequence of either 2-tuples like [(x, y), (x, y), …] or numeric values like [x, y, x, y, …].
fill – Color to use for the line.
width –The line width, in pixels. Note that line joins are not handled well, so wide polylines will not look good.
Returns: An Image object in ellipse shape.
Another Example: Here we use different colour for filling.
- Reusable piece of python functionality for wrapping arbitrary blocks of code : Python Context Managers
- Python - Read blob object in python using wand library
- twitter-text-python (ttp) module - Python
- Python | Index of Non-Zero elements in Python list
- Python | Convert list to Python array
- Python | Merge Python key values to list
- Python | PRAW - Python Reddit API Wrapper
- Important differences between Python 2.x and Python 3.x with examples
- MySQL-Connector-Python module in Python
- Reading Python File-Like Objects from C | Python
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Sort Python Dictionaries by Key or Value
- Python | Add Logging to a Python Script
- Python | Add Logging to Python Libraries
- Python | Visualizing O(n) using Python
- Use of min() and max() in Python
- gcd() in Python
- pow() in Python
- zip() in Python
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.