diff --git a/src/PIL/Image.py b/src/PIL/Image.py index ed90a26f7..b36f64735 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -2181,12 +2181,14 @@ class Image: It may also be an :py:class:`~PIL.Image.ImageTransformHandler` object:: + class Example(Image.ImageTransformHandler): def transform(size, method, data, resample, fill=1): # Return result It may also be an object with a :py:meth:`~method.getdata` method that returns a tuple supplying new **method** and **data** values:: + class Example(object): def getdata(self): method = Image.EXTENT diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py index 3a6dabf5e..4391af569 100644 --- a/src/PIL/ImageOps.py +++ b/src/PIL/ImageOps.py @@ -234,6 +234,7 @@ def pad(image, size, method=Image.BICUBIC, color=None, centering=(0.5, 0.5)): :param color: The background color of the padded image. :param centering: Control the position of the original image within the padded version. + (0.5, 0.5) will keep the image centered (0, 0) will keep the image aligned to the top left (1, 1) will keep the image aligned to the bottom