This paper presents a direct photon-counting X-ray image detector with a HgI2 photoconductor for high-quality medical imaging applications. The proposed sampling-based charge preamplifier with asynchronous self-reset enables a pixel to detect single X-ray photon energy with higher sensitivity and faster processing rate. The use of the correlated double sampling enabled by the sampling-based architecture also reduces flicker noise and contributes to the achievement of high pixel-to-pixel uniformity. Discrimination of the energy level of the detected X-rays is performed by the proposed compact in-pixel ADC with low power consumption. Three 15-bit counters in each pixel count up energy-discriminated photons for the reconstruction of multi-spectral X-ray images. A 128 x 128 X-ray image detector with a pixel size of 60 x 60 mu m(2) is implemented and measured using a 0.13-mu m/0.35-mu m standard CMOS process. It discriminates 3 energy levels of photon energy with a gain of 107 mV/ke(-) and a static power consumption of 4.6.mu W/pixel. The measured equivalent noise charge (ENC) and minimum detectable energy level of the detector pixel are 68 e(-) rms and 290 e(-), respectively. The measured maximum threshold dispersion in the pixel array is 164e(-) rms without any calibration. The functionality of our chip is also successfully demonstrated using real X-ray images.