def resize_image(image, ratio=(775/512)):
    """Helper function to resize image with specific ration"""
    new_size = (int(round(image.size[0] / ratio)),
                int(round(image.size[1] / ratio)))

    image = image.resize(new_size)
    return image