def METHOD_NAME(
    img: np.ndarray,
    height_source: HeightSource,
    blur_sharp: float,
    min_z: float,
    scale: float,
    edge_filter: EdgeFilter,
    invert: int,
    alpha_output: AlphaOutput,
) -> np.ndarray:
    h, w, c = get_h_w_c(img)
    height = get_height_map(img, height_source)
    if blur_sharp < 0:
        # blur
        height = fast_gaussian_blur(height, -blur_sharp)
    elif blur_sharp > 0:
        # sharpen
        blurred = fast_gaussian_blur(height, blur_sharp)
        height = cv2.addWeighted(height, 2.0, blurred, -1.0, 0)
    if min_z > 0:
        height = np.maximum(min_z, height)
    if scale != 0:
        height = height * scale  # type: ignore
    filter_x, filter_y = get_filter_kernels(edge_filter)
    dx = cv2.filter2D(height, -1, filter_x)
    dy = cv2.filter2D(height, -1, filter_y)
    x, y, z = normalize(dx, dy)
    if invert & 1 != 0:
        x = -x
    if invert & 2 != 0:
        y = -y
    if alpha_output is AlphaOutput.NONE:
        a = None
    elif alpha_output is AlphaOutput.HEIGHT:
        a = height
    elif alpha_output is AlphaOutput.UNCHANGED:
        a = np.ones((h, w), dtype=np.float32) if c < 4 else img[:, :, 3]
    elif alpha_output is AlphaOutput.ONE:
        a = np.ones((h, w), dtype=np.float32)
    else:
        assert False, f"Invalid alpha output '{alpha_output}'"
    r = (x + 1) * 0.5
    g = (y + 1) * 0.5
    b = np.abs(z)
    channels = (b, g, r) if a is None else (b, g, r, a)
    return cv2.merge(channels)