def _ints_almost_equal(
    a: int,
    b: int,
    tolerance=1) -> bool:
    """ Returns true if the integers are almost equal (applying tolerance)

    Args:
        a, b: integers to compare (e.g. pixel)
        tolerance: integer tolerance to add for almost equal

    Returns:
        True if almost equal within the provided tolerance. False otherwise.

    """

    return abs(a - b) <= tolerance