Digital images, particularly medical images, are prone to various noise attacks, such as additive, multiplicative, etc. Salt and pepper noise (SPN) is a type of multiplicative noise that degrades image quality and complicates identification, potentially leading to inaccurate diagnoses. Removing SPN is crucial yet challenging as noise removal can also eliminate important edge details. This study addresses the challenge of removing SPN without losing edge details. Existing SPN filtering algorithms, such as Average Filter (AF), Median Filter (MF), Switched MF (SMF), Adaptive MF (AMF), and Decision-based MF (DMF), perform poorly under high SPN attacks. We propose two effective SPN filters, CA_SPN1 and CA_SPN2, under the framework of Cellular Automata (CA) and MF. CA_SPN1 excels at high SPN levels, while CA_SPN2, a combination of CA_SPN1 and AMF, is effective across all SPN levels. Quality evaluations using Image Quality Assessment (IQA) metrics – Peak Signal to Noise Ratio (PSNR), Structural Similarity Index (SSIM), Figure of Merit (FOM), and Perceptual Similarity (PSIM) – demonstrate that the proposed algorithms restore images more effectively while preserving edge details compared to state-of-the-art algorithms. Furthermore, experimental results confirm the superior restoration quality of the proposed filters, particularly under high SPN conditions.