A new diagnostic tool has recently been developed, which allows to get 2D images of X-ray sources with simultaneous energy encoded information. This is achieved by using a pinhole camera scheme in which a CCD camera, forced to operate in the single-photon regime, is used as a detector. The use of this method, initially limited to a single pinhole, multi-shot basis, has recently been extended to single-shot experiments typical of large scale installations using custom pinhole arrays of sub-10μm diameter. Preliminary tests have been carried out at the PALS facility and the diagnostics has been successfully employed in a PW environment in a recent experiment at RAL. The details of the method as well as some results from such recent experiments will be given.