A novel technique is presented to detect and remove the salt and pepper noise in digital color images. The algorithm is proposed for detection of noisy pixel, edges and noise free pixels by utilizing basic property of salt and pepper noise. Each pixel is treated according whether it is edge pixel, noisy pixel or pixel from smooth region etc. Noisy pixel are replaced with median of neighborhood of noise free pixel. The edge pixel are given special attention so that we do not loose them during the process of noise reduction because of similar nature of intensity difference for impulse noise and edge pixels. For removing noisy pixel from an edge, the median of noise free each pixels are used which led to appreciable reduction of impulse noise and almost no effect on edges. This algorithm gives noticeable better results than most of the existing filters.