A new operator for restoring digital images corrupted by impulse noise is presented. The proposed operator is a hybrid filter obtained by appropriately combining a median filter, an edge detector, and a neuro-fuzzy network. The internal parameters of the neuro-fuzzy network are adaptively optimized by training. The training is easily accomplished by using simple artificial images that can be generated in a computer. The most distinctive feature of the proposed operator over most other operators is that it offers excellent line, edge, detail, and texture preservation performance while, at the same time, effectively removing noise from the input image. Extensive simulation experiments show that the proposed operator may be used for efficient restoration of digital images corrupted by impulse noise without distorting the useful information in the image.