This paper presents a new method for detecting random-valued impulse noise (RVIN) in images. The proposed method is based on similar valued neighbor criterion and the detection of the noisy pixels are realized in maximum four phases. After the corrupted pixels detected in each phase, the median filtering is performed for only these pixels. As such, corrupted pixels are suppressed gradually at the end of the each phase. The performance of the proposed method is evaluated on different test images and compared with ten different comparison filters from the literature. It is shown from simulation results that proposed method provides a significant improvement over comparison filters. (C) 2013 Elsevier GmbH. All rights reserved.