Photon counting detector (PCD) provides spectral information for estimating basis line-integrals; however, the recorded spectrum is distorted from spectral response effect (SRE). One of the conventional approaches to compensate for the SRE is to incorporate the SRE model in the forward imaging process. For this purpose, we recently developed a three-step algorithm as a (~×1, 500) fast alternative to maximum likelihood (ML) estimator based on the modeling of x-ray transmittance, exp ( − ∫ µa(r, E)dr ) , with low-order polynomials. However, it is limited on the case when K-edge is absent due to the smoothness property of the low-order polynomials. In this paper, we propose a dictionary learning-based x-ray transmittance modeling to address this limitation. More specifically, we design a dictionary which consists of several energy-dependent bases to model an unknown x-ray transmittance by training the dictionary based on various known x-ray transmittance as a training data. We show that the number of bases in the dictionary can be as large as the number of energy bins and that the modeling error is relatively small considering a practical number of energy bins. Once the dictionary is trained, the three-step algorithm can be derived as follows: estimating the unknown coefficients of the dictionary, estimating basis line-integrals, and then correcting for a bias. We validate the proposed method with various simulation studies for K-edge imaging with gadolinium contrast agent, and show that both bias and computational time are substantially reduced compared to those of the ML estimator.