def isequal(f1, f2):
    """
    r_eq = isequal(f1, f2)

    Check if two images are equal

    `isequal` compares the images `f1` and f2 and returns `True`, if
    `f1 and `f2` have the same size and `f1(x) == f2(x)`, for all pixel `x`;
    otherwise, returns `False`.

    Parameters
    ----------
    f1 :  Unsigned gray-scale (uint8 or uint16), signed (int32) or binary image.
    f2 :  Unsigned gray-scale (uint8 or uint16), signed (int32) or binary image.

    Returns
    -------
    r_eq : Boolean
        Whether the two images are equal
    """
    import numpy
    if f1.shape != f2.shape:
        return False
    return numpy.all(f1 == f2)
