def resize_canvas(old_image_path='314.jpg', new_image_path='save.jpg',
    canvas_width=500, canvas_height=500):
    """Resize the canvas of old_image_path and store the new image in
       new_image_path. Center the image on the new canvas.
    """
im = Image.open(old_image_path)
old_width, old_height = im.size
x1 = int(math.floor((canvas_width - old_width) / 2))
y1 = int(math.floor((canvas_height - old_height) / 2))
mode = im.mode
if len(mode) == 1:
    new_background = 255
if len(mode) == 3:
    new_background = 255, 255, 255
if len(mode) == 4:
    new_background = 255, 255, 255, 255
newImage = Image.new(mode, (canvas_width, canvas_height), new_background)
newImage.paste(im, (x1, y1, x1 + old_width, y1 + old_height))
newImage.save(new_image_path)
resize_canvas()
В Python, библиотека изображений Python 1.1.6, как я могу расширить холст без изменения размера?