A new directional weighted median filter is proposed for removing random-valued impulse noise. It uses differences between pixel values and neighbors in four directions to detect impulse noise. Then, a weighted median filter is applied, which can preserve edges while removing noise. However, it works poorly for highly corrupted images.
A decision-based unsymmetrical trimmed median filter is introduced to remove high density salt and pepper noise. It uses a 3x3 window and checks for corrupted pixels values of 0 or 255. Pixels are sorted and trimmed means or medians are applied depending on the number of corrupted pixels to denoise while preserving textures and edges.