Optical spectrometers, instruments that work with monochromatic light, are commonly rated by the spectral bandwidth, which defines the ability to resolve closely spaced spectral components. The ability to detect faint objects among these components, spectral contrast, is another desired aspect.Here we demonstrate that a combined effect of angular dispersion (AD) and anomalous transmission (AT) of x rays in Bragg reflection from asymmetrically cut crystals can shape spectral distributions of x rays to profiles with record high contrast and small bandwidths.The AD&AT x-ray optics is implemented as a five-reflection three-crystal arrangement featuring a combination of the above mentioned attributes, so much desirable for x-ray monochromators and analyzers: a spectral contrast of 500, a bandwidth of 0.46 meV and a remarkably large angular acceptance of 107 µrad. The new optics can become a foundation for the next generation inelastic x-ray scattering spectrometers for studies of atomic dynamics.