Fueled by research and applications in medical imaging, X-ray nondestructive testing, and high-energy particle detection, the demand for high-performance X-ray scintillator imagers is escalating. Yet, high-quality imaging is compromised due to the attenuation of the image details caused by the refractive index differences between the two sides of the emission interface. Although encoding high-frequency image information using periodic metasurfaces on the exit surface of the scintillators can mitigate considerable high-frequency information loss, current decoding solutions remain inchoate, even in principle. Addressing this, we present a universal framework that combines optical encoding with deep-learning-assisted image decoding in the X-ray incoherent imaging process. The targeted structured deep neural network (DNN), trained with a meticulously configured data set, successfully deciphers the physical mechanism within the X-ray scintillation encoded imaging process. This highlights the broad applicability across various samples, eliminating the need for additional transfer learning on the sample side. The results exhibit a striking 10-fold improvement in the signal-to-noise ratio (SNR) and a 6-fold increase in detection efficiency. We anticipate that our framework will augment the fundamental understanding of X-ray imaging as well as prove great significance for biological imaging applications.