def normalize(x, y, viewbox):
    """Normalize so that the origin is at the bottom center of the image,
    and the height of the image is 1
    """
    xi, yi, width, height = viewbox
    return (x - xi - width / 2) / height, (yi + height - y) / height