In this paper we introduce a new linear filtering technique, the so-called matrix filters, that maximizes the signal-to-interference ratio of compact sources of unknown intensity embedded in a set of images by taking into account the cross-correlations between the different channels. By construction, the new filtering technique outperforms (or at least equals) the standard matched filter applied on individual images. An immediate application is the detection of extragalactic point sources in Cosmic Microwave Background images obtained at different wavelengths. We test the new technique in two simulated cases: a simple two-channel case with ideal correlated color noise and more realistic simulations of the sky as it will be observed by the LFI instrument of the upcoming ESAs Planck mission. In both cases we observe an improvement with respect to the standard matched filter in terms of signal-to-noise interference, number of detections and number of false alarms.