Abstract-Digital image quality is of importance in almost all image processing applications. Many different approaches have been proposed for restoring the image quality depending on the nature of the degradation. One of the most common problems that cause such degradation is impulse noise. In general, well known median filters are preferred for eliminating different types of noise. Soft morphological filters are recently introduced and have been in use for many purposes. In this study, we present a Genetic Algorithm (GA) which combines different objectives as a weighted sum under a single evaluation function and generates a soft morphological filter to deal with impulse noise, after a training process with small images. The automatically generated filter performs better than the median filter and achieves comparable results to the best known filters from the literature over a set of benchmark instances that are larger than the training instances. Moreover, although the training process involves only impulse noise added images, the same evolved filter performs better than the median filter for eliminating Gaussian noise as well.