import random


def intensity_scale(factor_min=0.95, factor_max=1.05):
    """
    Multiplies all spectral bands by a single random factor.

    Parameters
    ----------
    factor_min : float, optional
        Lower bound for random factor.
    factor_max : float, optional
        Upper bound for random factor.

    Returns
    -------
    apply_transform : func
        Transformation for image/mask pairs.
    """
    def apply_transform(img, mask):
        img = img * random.uniform(factor_min, factor_max)
        return img, mask
    return apply_transform