This paper proposes a new switching median filter for suppressing multi-pixel impulse noise in X-ray images. A multi-pixel impulse is understood as a set of several neighboring pixels, the intensity of each significantly exceeds background intensity. Multi-pixel noise can occur, for example, due to the blooming effect, the reason being the limited value of pixel saturation capacity. This article defines the thresholds for the intensity increment relative to the eight immediate neighbors, above which the current pixel is processed by the median filter. The dependence of these thresholds on the number of pixels in an impulse is presented. The proposed algorithm is based on the median filtering process, which consists of several iterations. In this case, the filter has the smallest possible size, which minimizes image distortion during processing. In particular, to exclude a single-pixel impulse, pixel processing is turned on when intensity surge exceeds 3.5 with the grayscale value ranging from 0 to 1. At the same time, to exclude nine-pixel impulses, three iterations are required with the following thresholds: the first iteration with a threshold 2.0; the second iteration also with a threshold 2.0 and the third iteration with a threshold 3.5. The algorithm proposed was tested on real X-ray images corrupted by multi-pixel impulse noise. The algorithm is not only simple, but also reliable and suitable for real-time implementation and application. The efficiency of the technique is shown in comparison with other known filtering methods with respect to the degree of noise suppression. The main result of the testing is that only the proposed method allows excluding multi-pixel noise. Other advantage of the algorithm is its weak effect on the level of Gaussian noise leading to the absence of image blurring (or preserving image details) during processing.