def getImageOffset(img, pos, box=(156, 156)):
    """ Determine the required image offset

    Params:
        img -- The PIL Image object
        pos -- The (x,y) postion
        box -- The bounding box (x,y) position

    Returns:
         A tuple containg the offset coordinates (j,k)
    """
    x_offset = max((box[0] - img.size[0]) / 2, 0)
    y_offset = max((box[1] - img.size[1]) / 2, 0)
    j = pos[0] + x_offset
    k = pos[1] + y_offset
    return (j, k)