from PIL import Image

def make_square(im, min_size=256, fill_color=(255, 255, 255, 0)):
    x, y = im.size
    size = max(min_size, x, y)
    if im.mode == "PNG":
        new_im = Image.new('RGBA', (size, size), fill_color)
    else:
        new_im = Image.new('RGB', (size, size), fill_color)
    new_im.paste(im, (int((size - x) / 2), int((size - y) / 2)))
    return new_im