The semiconductor pixel detector Timepix (256 × 256 pixels with pitch of 55 um) can be used for energy measurements. This measurements require knowledge of the energy calibration of each pixel of the matrix. Such a calibration is very nonlinear in the low energy range. A method already exists that uses radiation sources for calibration of each pixel of the matrix. The response of each pixel is measured and evaluated in order to acquire parameters for a surrogate calibration function. This method requires analysis of thousands of spectra and performing thousands of fits. A new calibration procedure has been designed that combines Timepix test pulse functionality and measurement with radiation sources. This procedure significantly reduces time needed for calibration. In the first part of the method a relative calibration is obtain by injecting a defined test charges into all pixels of the matrix. In the second phase a calibration precision is improved and converted to absolute scale by irradiating the detector with a source. After such a complex calibration, it is possible to perform a recalibration of the detector, without the need for a source. The new procedure is fully automatic and is built into a current control and data acquisition software for Timepix detectors as an extension module.