Laser-based optical diagnostics, such as planar laser-induced fluorescence and, especially, Raman imaging, often require selective spectral filtering. We advocate the use of an imaging spectrograph with a broad entrance slit as a spectral filter for two-dimensional imaging. A spectrograph in this mode of operation produces output that is a convolution of the spatial and spectral information that is present in the incident light. We describe an analytical deconvolution procedure, based on Bayesian statistics, that retrieves the spatial information while it avoids excessive noise blowup. The method permits direct imaging through a spectrograph, even under broadband illumination. We introduce the formalism and discuss the underlying assumption...