The PIL.ImagePath Module

Path(xy) (class) [#]

Path wrapper.

For more information about this class, see The Path Class.

The Path Class

Path(xy) (class) [#]

Path wrapper.

__init__(xy) [#]

Creates a path object.

xy
Sequence. The sequence can contain 2-tuples [(x, y), ...] or a flat list of numbers [x, y, ...].

compact(distance=2) [#]

Compacts the path, by removing points that are close to each other. This method modifies the path in place.

getbbox() [#]

Gets the bounding box.

map(function) [#]

Maps the path through a function.

tolist(flat=0) [#]

Converts the path to Python list.

flat
By default, this function returns a list of 2-tuples [(x, y), ...]. If this argument is true, it returns a flat list [x, y, ...] instead.
Returns:
A list of coordinates.

transform(matrix) [#]

Transforms the path.