ImageDraw.Draw.rectangle-method/">rectangle()
Draws a rectangle-method/">rectangle.
Syntax: PIL.ImageDraw. Draw.rectangle-method/">rectangle (xy, fill = None, outline = None)
Parameters:xy - Four points to define the bounding box ... Sequence of either [(x0, y0), (x1, y1)] or [x0, y0, x1, y1]. The second point is just outside the drawn rectangle-method/">rectangle.
outline - Color to use for the outline.
fill - Color to use for the fill.Returns: An Image object in rectangle-method/">rectangle shape.
|
Output:
Another example: here we use a different fill color.
|
Output: