Automatic restoration of old film archives has become of increasing interest in the last few years with the rise of consumer digital video applications and the need to supply more programming material of an acceptable quality in a multimedia context. A technique is described for the optimization of multidimensional grayscale soft morphological filters for applications in automatic film archive restoration, specific to the problem of film dirt removal. The optimization is undertaken with respect to a criterion based on mean absolute error and is performed using a genetic algorithm. Experiments have shown that the filter found using this technique has excellent performance in attenuating/removing film dirt from image sequences and has little, if any, effect on the image detail. The results of applying such a filter to a real image sequence were analyzed and compared to those obtained by restoring the same image sequence using a global filtering approach (LUM filter) and a spatio-temporal local filtering approach (ML3Dex filter with noise detection). From a film dirt removal point of view, the optimized soft morphological filter showed improved results compared to the LUM filter and comparable results with respect to the ML3Dex filter with noise detection. Also, the optimized filter accurately restored all fast-moving objects present in the sequence, without the need for motion compensation, whereas the other two methods failed to do this. The proposed method proved to be a simple, fast, and cheap approach for the automatic restoration of old film archives.