def random_gamma(gamma=lambda: np.random.rand() * 0.4 + 0.8): def call(x): return exposure.adjust_gamma(x, gamma()) return call