In this paper, we propose a simple but efficient filter to effectively remove salt-and-pepper noise from highly corrupted images inspired by the corresponding limitations of existing filtering methods. After ensuring the location of ill pixels based on their intensity value, our method then utilizes the iterative processing framework to gradually restore the noisy images. When the useful information of one corrupted image is much enough, the proposed method can refine the results through particular designed criterion. The experiments from standard test images show that the proposed method can better recover the detail information and maintain the optimal performances qualitatively and quantitatively in the comparisons. Even the ratio of salt-and-pepper noise is as high as 95%, the advantage of our filter is still significant.