This paper discusses a class of simple noise-reduction and contrast-enhancement algorithms. In these algorithms, the image is decomposed locally into its mean value and residue image, i.e., the deviation from the mean value. The relative weight of each component is altered under the control of the mean value and an energy measure that is obtained through quadratic filtering of the input image. This adaptive residue-image processing technique can be implemented with the aid of a few operations per pixel and is hence suitable for real-time applications. Moreover, it performs well, is flexible and generalizes several existing algorithms. In addition, we also derive how the noise variance, which is an important parameter in the algorithm, can be estimated from the histogram of the energy measure.