def _is_mono(pixels):
    """
    Predicate function for monochrome or not.

    >>> _is_mono(np.array([[[0, 0, 0]]]))
    False
    >>> _is_mono(np.array([[0]]))
    True
    >>> _is_mono(np.array([[[0]]]))
    True
    """
    return pixels.ndim == 2 or pixels.ndim == 3 and pixels.shape[-1] == 1
