A method is for generating a mixed image data record based on energy-resolved recording via an energy-resolving X-ray detector. In an embodiment, the method includes generating a first image value of a first image element of a first image data record in a first energy range and generating a second image value of the first image element of a second image data record in a second energy range; and mixing the first image value generated and the second image value generated in dependence on an image parameter, to generate the mixed image data record with a mixed image value of the first image element.