The novel two-state switching mean filter is proposed to remove the impulse noise from the highly corrupted image. In the proposed filter, the distinctive noise detector using two different noise detection windows is adopted to classify the pixels in the image as noise candidates and noise-free pixels. The number of noise pixels is calculated to estimate the noise density in the image, based on which two-state mean filter is adopted to remove the detected impulse noise. Simulation results show that the proposed filter outperforms the traditional median filter and a number of existing decision-based filters in that it can detect the impulse noise in the image accurately and it can suppress noise effectively while preserving fine details in the image very well.