The quality and availability of room temperature CdTe sensor material for X-ray detection has improved significantly in the last years. A CdTe sensor with different pixel pitches and electrode pad sizes was bump-bonded to a Medipix2-MXR ASIC. With this photon counting detector we were able to investigate the influence of pixel pitch and electrode pad size on the energy response functions. The accurate knowledge of the energy response is crucial for energy resolving X-ray imaging. Therefore we exposed the detector to gamma rays of 241Am and 57Co. In the following analysis of the energy response spectra we determined the number of events in the photo peak, the energy resolution and the threshold energy where the photo peak is found (photo peak position) caused by the absorption of the 59.5 keV photons of 241Am. For the energy calibration we used the 59.5 keV photons of 241Am and the 122 keV photons of 57Co. Concerning energy resolution, energy threshold calibration and photo peak position our measurements show good agreement with the expected behaviour. The number of events in the photo peak strongly depends on the pixel pitch and the electrode pad configuration.