A theoretical analysis is presented on how to separate the contributions from individual, simultaneously present fluorophores in a spectrally resolved image. Equations are derived that allow the calculation of the signal-to-noise ratio of the estimates for such contributions, given the spectral information on the individual fluorophores, the excitation wavelengths and intensities, and the number and widths of the spectral detection channels. We then ask how such imaging parameters have to be chosen for optimal fluorophore separation. We optimize the signal-to-noise ratio or optimize a newly defined 'figure of merit', which is a measure of efficiency in the use of emitted photons. The influence of photobleaching on the resolution and on the choice of imaging parameters is discussed, as well as the additional resolution gained by including fluorescence lifetime information. A surprisingly small number of spectral channels are required for an almost optimal resolution, if the borders of these channels are optimally selected. The detailed consideration of photobleaching is found to be essential, whenever there is significant bleaching. Consideration of fluorescence lifetime information (in addition to spectral information) improves results, particularly when lifetimes differ by more than a factor of two.