A computer-implemented method for evaluating a multi-energy X-ray image in material sorting by means of basis material decomposition: a) obtaining a multi-energy X-ray image of a material including a first material area belonging to a first material and a second material area belonging to a second material; wherein the first material area and the second material area are located next to each other, wherein in the multi-energy X-ray image a first area results from the irradiation of the first material area and a second area results from the irradiation of the second material area; b) processing the multi-energy X-ray image by irradiation values measured during irradiation of the material for at least the first and the second areas by means of the basis material decomposition while determining at least a first reference value for a first basis material and a second reference value for a second basis material to obtain a first representation for the areas characterizing the first basis material and a second representation for the areas characterizing the second basis material; c) evaluating the first representation with respect to a manifestation of a first area resulting from the irradiation of the first material area and with respect to a manifestation of a second area resulting from the irradiation of the second material area; d) evaluating the second representation with respect to the manifestation of a second area resulting from the irradiation of the second material area and with respect to the manifestation of a first area resulting from the irradiation of the first material area; and e) repeating steps b) to d) with varied first and varied second reference values (B1', B2') allocated to other first and other second basis materials to obtain and evaluate further first and further second representations until the manifestation of the second area in the further first representations and/or until the manifestation of the first area in the further second representations is/are minimum or minimum regarding its amount. a) obtaining a multi-energy X-ray image of a material including a first material area belonging to a first material and a second material area belonging to a second material; wherein the first material area and the second material area are located next to each other, wherein in the multi-energy X-ray image a first area results from the irradiation of the first material area and a second area results from the irradiation of the second material area; b) processing the multi-energy X-ray image by irradiation values measured during irradiation of the material for at least the first and the second areas by means of the basis material decomposition while determining at least a first reference value for a first basis material and a second reference value for a second basis material to obtain a first representation for the areas characterizing the first basis material and a second representation for the areas characterizing the second basis material; c) evaluating the first representation with respect to a manifestation of a first area resulting from the irradiation of the first material area and with respect to a manifestation of a second area resulting from the irradiation of the second material area; d) evaluating the second representation with respect to the manifestation of a second area resulting from the irradiation of the second material area and with respect to the manifestation of a first area resulting from the irradiation of the first material area; and e) repeating steps b) to d) with varied first and varied second reference values (B1', B2') allocated to other first and other second basis materials to obtain and evaluate further first and further second representations until the manifestation of the second area in the further first representations and/or until the manifestation of the first area in the further second representations is/are minimum or minimum regarding its amount.