Spectroscopic X-ray imaging using a Pixelated detector with single photon processing readout