Purpose One of the fundamental tasks in the field of image processing is image denoising. Images are often corrupted by different types of noise and the restoration of images degraded with random-valued impulse noise is still a challenging task. The paper aims to discuss these issues. Design/methodology/approach This paper presents an adaptive threshold-based impulse noise detection following by a novel selective window median filter for restoration of RVIN pixels. Findings The proposed method emphasis a local image statistics using an exponential nonlinear function with an adaptive threshold is derived from the rank-ordered trimmed median absolute difference (ROTMAD) are deliberated to detect the noisy pixels. In the filtering stage, a selective 3×3 moving window median filter is applied to restore the detected noisy pixel. Originality/value Experimental result shows that the proposed algorithm outperforms the existing state-of-art techniques in terms of noise removal and quantitative metrics such as peak signal to noise ratio (PSNR), mean absolute error (MAE), structural similarity index metric (SSIM) and miss and false detection rate.