This paper proposes a new algorithm for restoration of gray scale images corrupted by salt and pepper noise(SPN). The proposed algoritm identifies a pixel as noisy if its intensity value is 0 or 255 and processes it using pixels in a 3×3 window. If the window consists of noisy and non-noisy pixels, then the pixel to be processed is replaced with the trimmed median value of the non-noisy pixels. However, if only noisy pixels are there in the window then their mean value is used to process the pixel. The proposed method uses processed (i.e. the de-noised) pixels in the window while processing the noisy pixels and shows significantly better performance, particularly at high noise density, as compared to various methods reported in literature. Experimental results show improvements both visually and quantitatively compared to other reported methods. © 2015 IEEE.