In K-edge decomposition imaging for the multienergy system with the photon counting detectors (PCDs), the energy bins significantly affect the intensity of the extracted K-edge signal. Optimized energy bins can provide a better K-edge signal to improve the quality of the decomposition images and have the potential to reduce the amount of contrast agents. In this article, we present the Gaussian spectrum selection method (GSSM) for the multienergy K-edge decomposition imaging which can extract an optimized K-edge signal by optimizing energy bins compared with the conventional theoretical attenuation selection method (TASM). GSSM decides the width and locations of the energy bins using a simple but effective model of the imaging system, which takes the degraded energy resolution of the detector and the continuous x-ray spectrum into consideration. Besides, we establish the objective function, difference of attenuation to relative standard deviation ratio (DAR), to determine the optimal energy bins which maximize the K-edge signal. The results show that GSSM gets a better K-edge signal than TASM especially at the lower concentration level of contrast agents. The new method has the potential to improve the contrast and reduce the amount of contrast agents.