Hybrid pixel radiation detectors with a direct photon-to-charge conversion working in a single photon counting mode have gained increasing attention due to their high dynamic range and noiseless imaging. Since sensors of different materials can be attached to readout electronics, they enable work with a wide range of photon energies. The charge-sharing effect observed in segmented devices, such as hybrid pixel detectors, is a phenomenon that deteriorates both spatial resolution and detection efficiency. Algorithms that allow the detection of a photon irrespective of the charge-sharing effect are proposed to overcome these limitations. However, the spatial resolution of the detector can be further improved beyond the resolution determined by the pixel size if information about the charge proportions collected by neighbouring pixels is used to approximate the interaction position. In the article, an approach to achieve a subpixel resolution in a hybrid pixel detector working in the single photon counting mode is described. Requirements and limitations of digital inter-pixel algorithms which can be implemented on-chip are studied. In the simulations, the factors influencing the detector resolution are evaluated, including size of a charge cloud, number of virtual pixel subdivisions, and detector parameters.