1. A method for imaging comprising: obtaining a spectral weighting function indicative of an attribute of the reference sample; illuminating a target sample with light whose spectral flux distribution corresponds to the spectral weighting function to produce a corresponding target image, wherein the target image is indicative of a response of the target sample to the corresponding illumination at multiple spatial locations of the target sample; and identifying one or more target features in the target sample based on the target image.