A new rank order operator—the variable median filter—for the restoration of images corrupted with spike noise is introduced. It can be adapted to the diameter of noise grains, while all other useful properties of the 2-dimensional median filter—edge preservation and impulse noise attenuation—are maintained. This concept is applied to DCT coded images for removing the typical ringing. The coder parameters are used to predict the error structure and adapt the filter locally. The image enhancement is demonstrated by a 64 kbit/s video phone simulation.