Disclosed are methods and devices for estimating object scatter and/or internal scatter in a multi-level photon-counting x-ray detector, as well as x-ray tomographic imaging while correcting for object and internal scatter. The x-ray detector has at least two layers of detector diodes mounted in an edge-on geometry, e.g. designed for 1) estimating the object scatter contribution to the counts in a top layer of the at least two layers based on difference(s) in counts between the top layer and lower layer(s) under the assumption the object scatter has a slowly varying spatial distribution, and/or 2) estimating counts from reabsorption of photons that have Compton scattered inside the detector based on selectively blinding some detector elements from primary radiation by placing a highly attenuating beam stop on top of the detector elements, in lower layer(s) or in both top layer and lower layer(s), and measuring the counts in those detector elements.