Processing electronics for a detector of an X-ray imaging device, the processing electronics comprising: - a pulse counter section having at least one count output, - an integrator section having an intensity output, wherein the processing electronics is adapted to be connected to a sensor in such a manner that X-ray photons arriving at the sensor can be processed by the pulse counter section, by the integrator section, or both, and - a processor connected to the count output and to the intensity output, characterized in that the processor is adapted to output a count result that takes into account both count information obtained at the count output and intensity information obtained at the intensity output, so that the count result contains information obtained from the pulse counter section and further count information obtained from the integrator section, wherein the processor is adapted to obtain the count result by weighing the count information versus the further count information and to perform weighing by - multiplying the further count information with a first weight (w 1), wherein the first weight (w 1) is derived as a value of a function (f) that receives as an input at least one variable from the group consisting of count information, intensity information, further count information and a primary intensity value (I 0), wherein the primary intensity value (I 0) is the intensity without attenuation by an object and wherein the function (f) is a sigmoid function or has a shape like a sigmoid function, - multiplying the count information with a second weight (w 2), and - adding the products resulting from the multiplying, and wherein the processor is adapted to increase the second weight (w 2) when at least one of the conditions of a reduced count value and a reduced intensity value is present and/or to decrease the second weight (w 2) when at least one of the conditions of an increased count value and an increased intensity value is present. - a pulse counter section having at least one count output, - an integrator section having an intensity output, wherein the processing electronics is adapted to be connected to a sensor in such a manner that X-ray photons arriving at the sensor can be processed by the pulse counter section, by the integrator section, or both, and - a processor connected to the count output and to the intensity output, characterized in that the processor is adapted to output a count result that takes into account both count information obtained at the count output and intensity information obtained at the intensity output, so that the count result contains information obtained from the pulse counter section and further count information obtained from the integrator section, wherein the processor is adapted to obtain the count result by weighing the count information versus the further count information and to perform weighing by - multiplying the further count information with a first weight (w 1), wherein the first weight (w 1) is derived as a value of a function (f) that receives as an input at least one variable from the group consisting of count information, intensity information, further count information and a primary intensity value (I 0), wherein the primary intensity value (I 0) is the intensity without attenuation by an object and wherein the function (f) is a sigmoid function or has a shape like a sigmoid function, - multiplying the count information with a second weight (w 2), and - adding the products resulting from the multiplying, and wherein the processor is adapted to increase the second weight (w 2) when at least one of the conditions of a reduced count value and a reduced intensity value is present and/or to decrease the second weight (w 2) when at least one of the conditions of an increased count value and an increased intensity value is present.