Disclosed are methods, systems, apparatuses and computer programs for estimating a measure of the gain and offset of a converter that generates, based on digital settings, reference voltages to be used as thresholds by a comparator in a photon-counting detector in an x-ray imaging system. Steps include selecting a first converter as a reference converter and a second converter as a target converter; assigning different digital settings to the reference converter to generate at least two different reference voltages to be used as thresholds by a comparator associated with the reference converter; and obtaining, based on photon count measurements, the number of photons registered in a photon counter associated with a comparator whose reference voltage is generated by the target converter. Based on the number of photons and the at least two digital settings, an estimate of the gain and offset of the target converter relative the reference converter results.