Spatio-temporal retinex-inspired envelope with stochastic sampling : a framework for spatial color algorithms