We address state reconstruction by photon-number-resolving detectors, and demonstrate that they may be effectively exploited to perform quantum tomography of states of light. In particular, we find that the pattern function technique, originally developed for optical homodyne tomography, may be also applied to discrete data. Our results open new perspectives for quantum-state reconstruction in the mesoscopic regime, and pave the way to the use of photon-number-resolving-based detection schemes in Quantum Information science.