Denoising images using Markov random fields