In this paper, an image restoration algorithm that is based on the self-similarity gray value adjustment method is proposed for the images contaminated by impulse noise. In the preliminary phase, a selective median filter is used to detect and suppress impulse noise. Then a gray value adjustment method based on self-similarity is employed for eliminating the pixels relativity that is produced by the median filter. This algorithm uses an adaptive regularization method to restore the images. The regularization parameters are adaptively obtained through both the statistical parameters of image local region and the competition factors that are produced during the gray value adjustment procedure. The experimental results show that the restored images that are obtained by the proposed algorithm have better objective quality and subjective vision effect than that by some conventional methods for images contaminated by impulse noise.