Stains have been used in optical microscopy to visualize the distribution and intensity of substances to which they are attached. Quantitative measures of optical density in the microscopic images can in principle be used to determine the amount of the stain. When multiple dyes are used to simultaneously visualize several substances to which they are specifically attached, quantification of each stain cannot be made using any single wavelength because attenuation from the several stain components contributes to the total optical density. Although various dyes used as optical stains are perceived as specific colors, they, in fact, have complex attenuation spectra. In this paper, we present a technique for multiple wavelength image acquisition and spectral decomposition based upon the Lambert-Beer absorption law. This algorithm is implemented based on the different spectral properties of the various stain components. By using images captured at N wavelengths, N components with different colors can be separated. This algorithm is applied to microscopy images of doubly and triply labeled prostate tissue sections. Possible applications are discussed.