Abstract : The image restoration problem is addressed in the variational framework. The focus was set on denoising. The statistics of natural images are consistent with the Markov random field principles. Therefore, a restoration process should preserve the correlation between adjacent pixels. The proposed approach minimizes the conditional entropy of a pixel knowing its neighborhood. The conditional aspect helps preserving local image structures such as edges and textures. The statistical properties of the degraded image are estimated using a novel, adaptive weighted k-th nearest neighbor (kNN) strategy. The derived gradient descent procedure is mainly based on meanshift computations in this framework.