We investigate the improvement from the use of high-Z CdTe sensors for pre-clinical K-edge imaging with the hybrid pixel detectors XPAD3. We compare XPAD3 chips bump bonded to Si or CdTe sensors in identical experimental conditions. Image performance for narrow energy bin acquisitions and contrast-to-noise ratios of K-edge images are presented and compared. CdTe sensors achieve signal-to-noise ratios at least three times higher than Si sensors within narrow energy bins, thanks to their much higher detection efficiency. Nevertheless Si sensors provide better contrast-to-noise ratios in K-edge imaging when working at equivalent counting statistics, due to their better estimation of the attenuation coefficient of the contrast agent. Results are compared to simulated data in the case of the XPAD3/Si detector. Good agreement is observed when including charge sharing between pixels, which have a strong impact on contrast-to-noise ratios in K-edge images.