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.pieslice() Same as arc, but also draws straight lines between the end points and the center of the bounding box.
Syntax: PIL.ImageDraw.Draw.pieslice(xy, start, end, fill=None, outline=None)
xy – Four points to define the bounding box. Sequence of [(x0, y0), (x1, y1)] or [x0, y0, x1, y1].
start – Starting angle, in degrees. Angles are measured from 3 o’clock, increasing clockwise.
end – Ending angle, in degrees.
fill – Color to use for the fill.
outline – Color to use for the outline.
Returns: An Image object in pieslice shape.
Another Example: Here we use different colour for filling.
- Python - Read blob object in python using wand library
- Python | Index of Non-Zero elements in Python list
- Reading Python File-Like Objects from C | Python
- Python | PRAW - Python Reddit API Wrapper
- Important differences between Python 2.x and Python 3.x with examples
- MySQL-Connector-Python module in Python
- Python | Merge Python key values to list
- Python | Convert list to Python array
- Python | Add Logging to Python Libraries
- Python | Add Logging to a Python Script
- Python | Sort Python Dictionaries by Key or Value
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Visualizing O(n) using Python
- SHA in Python