In this paper, a new method for the identification and removal of random-valued impulse noise (RVIN) from images is proposed. We propose to identify the central pixel of the current sliding window as a noisy or noise free pixel based on the similar local statistics of the current window. Our proposed RVIN identifier works in an iterative way. Pixel identified as a noisy pixel is replaced by proposed minimum difference similar value in an optimal directions. The performance of the proposed method is evaluated on different test images and compared with state-of-the-art methods. Experimental results show that the proposed method cannot only identify the impulse noise efficiently, but can also preserve the detailed information of an image.