  A method is presented to precisely reconstruct charge spectra with pixel
detectors using binary hit information of individual pixels. The method is
independent of the charge information provided by the readout circuitry and has
a resolution mainly limited by the electronic noise. It relies on the ability
to change the detection threshold in small steps while counting hits from a
particle source. The errors are addressed and the performance of the method is
shown based on measurements with the ATLAS pixel chip FE-I4 bump bonded to a
230 {\mu}m 3D-silicon sensor. Charge spectra from radioactive sources and from
electron beams are presented serving as examples. It is demonstrated that a
charge resolution ({\sigma}<200 e) close to the electronic noise of the ATLAS
FE-I4 pixel chip can be achieved.
