Hybrid pixel detectors are segmented devices used for particles detection, consisting of a sensor and readout electronics. To improve the resolution of the detector and allow operation with high-intensity photon fluxes, the pixel size is reduced. However, with decreasing pixel size, a charge sharing effect is more significant. To detect a photon irrespectively of charge sharing effect, the total photon energy should be reconstructed from fractional signals. Therefore, the algorithms dealing with charge sharing are developed [1–4]. The resolution of such detectors is limited by the pixel size, which must be large enough to fit all the functionality required by the complex algorithms. However, there are known methods that can improve the spatial resolution of a detector applied for high energy physics [5], or astronomy [6–8], and both photon counting detectors [9–11] and integrating detectors [12–14] are used. An alternative digital solution that can be implemented on-chip dedicated to hybrid pixel detectors working in a single photon counting mode is presented in this work. In this approach, charge sharing becomes the desired effect, since the information on the proportions of charge collected by the pixels can be used to estimate the photon interaction position with subpixel resolution. In the work analytical approach towards detector and readout channel modeling is used to state the requirements for the algorithm. The concept of the new digital on-chip algorithm is presented.