An innovative fast system for x-ray imaging has been developed at ENEA-Frascati, Italy, in collaboration with INFN-Pisa, Italy. It is based on a pinhole camera coupled to a micropattern gas detector (MPGD) having a gas electron multiplier (GEM) as amplifying stage. This detector (2.5 cm×2.5 cm active area) is equipped with a two dimensional readout printed circuit board with 144 pixels (12×12). It is able to get x-ray images of the plasma at very high framing rate (up to 100 kHz) in a selectable x-ray energy range, with different magnifications or views of the plasma. The system has been tested successfully on the Frascati Tokamak Upgrade (FTU) during Summer 2001, with a one-dimensional perpendicular view of the plasma. In collaboration with ENEA, the Johns Hopkins University (JHU) and Princeton Plasma Physics (PPPL), this system has been setup and calibrated in the x-ray energy range 3–8 keV and it has been installed, with a tangential view, on the NSTX experiment at PPPL. Time resolved, two-dimensional x-ray images of the NSTX plasma core will be presented, with different magnifications and different orientations of the optical axis of the x-ray pinhole camera. Fast acquisitions, performed up to 50 kHz of framing rate, allow the study of the plasma evolution and the 2D shaping during MHD activity.