def METHOD_NAME(shape, gaps):
    """Build a mask image from the dist of gaps provided by `search_gaps`
    :param shape: shape of the image
    :param gaps: 2-tuple of start/end
    """
    g0, g1 = gaps
    mask = numpy.zeros(shape, dtype=numpy.int8)
    for start,stop in g0:
        mask[start:stop] = 1
    for start,stop in g1:
        mask[:, start:stop] = 1
    return mask