A new approach to time resolved two-dimensional x-ray imaging is presented. It is based on a micropattern gas detector with gas electron multiplier as amplifying stage and pixel readout. It allows x-ray photon counting at high detection efficiency, high signal to noise ratio, extremely high time resolution (framing rate up to 100 kHz), and with an innovative capability: the energy resolution. The detector has a limited number of pixels (up to tens of thousands), but each pixel behaves like a low-resolution spectrometer, allowing quasimonochromatic images or spectral scans. This new approach is proposed as an alternative to the traditional static, spectral integrated, noiser, high definition (millions of pixels) x-ray imaging as performed, for example, with charge coupled device based devices. All these innovative features have been tested on the National Spherical Torus Experiment (Princeton, USA) but the authors are firmly convinced that it will be applied to many other fields of research.