An apparatus for x-ray imaging comprising an x-ray source and an x-ray detector having a number of detector elements, wherein the x-ray source and the x-ray detector are arranged on a support that is able to rotate around a subject or object to be imaged to enable a set of projections at different view angles, wherein the apparatus is configured to operate the x-ray source in switched kVp mode for alternately applying at least two different voltages, including a lower voltage and a higher voltage, during rotation to enable lower-energy and higher-energy exposures over the set of projections, thereby providing for lower-energy projections and higher-energy projections, wherein the x-ray detector is a photon-counting multi-bin detector configured to allocate photon counts to multiple energy bins, and the apparatus is configured to select counts from at least a subset of the energy bins to provide corresponding photon count information for both lower-energy projections and higher-energy projections, wherein the apparatus is configured to perform material basis decomposition for each of a number of the lower-energy projections and higher-energy projections and/or for each of a number of combinations of at least one lower-energy projection and at least one higher-energy projection, based on the corresponding photon count information, wherein the apparatus is configured to perform said material basis decomposition to generate pathlength estimates of basis materials for each of a number of the lower-energy projections and higher-energy projections and/or for each of a number of combinations of at least one lower-energy projection and at least one higher-energy projection, and to perform image reconstruction based on the path length estimates; and characterized in that the apparatus is further configured to generate the pathlength estimates for basis materials and associated covariance matrices representing covariance of the estimated pathlengths, and to combine pathlength estimates for lower-energy and higher-energy projections based on the corresponding covariance matrices. wherein the apparatus is configured to operate the x-ray source in switched kVp mode for alternately applying at least two different voltages, including a lower voltage and a higher voltage, during rotation to enable lower-energy and higher-energy exposures over the set of projections, thereby providing for lower-energy projections and higher-energy projections, wherein the x-ray detector is a photon-counting multi-bin detector configured to allocate photon counts to multiple energy bins, and the apparatus is configured to select counts from at least a subset of the energy bins to provide corresponding photon count information for both lower-energy projections and higher-energy projections, wherein the apparatus is configured to perform material basis decomposition for each of a number of the lower-energy projections and higher-energy projections and/or for each of a number of combinations of at least one lower-energy projection and at least one higher-energy projection, based on the corresponding photon count information, wherein the apparatus is configured to perform said material basis decomposition to generate pathlength estimates of basis materials for each of a number of the lower-energy projections and higher-energy projections and/or for each of a number of combinations of at least one lower-energy projection and at least one higher-energy projection, and to perform image reconstruction based on the path length estimates; and characterized in that the apparatus is further configured to generate the pathlength estimates for basis materials and associated covariance matrices representing covariance of the estimated pathlengths, and to combine pathlength estimates for lower-energy and higher-energy projections based on the corresponding covariance matrices.