To accurately measure the near-wall flow by particle image velocimetry (PIV) is a big challenge, especially for the slip boundary condition. Apart from high-precision measurements, an appropriate PIV algorithm is important to resolve the near-wall velocity profile. In our study, single-pixel algorithm is employed to calculate the near-wall flow, which is demonstrated to be capable of accurately resolving the flow velocity near the slip boundary condition. Based on the synthetic particle images, the advantages of the single-pixel algorithm are manifested in comparison with the conventional window correlation algorithm. Specially, the single-pixel algorithm has higher spatial resolution and accuracy, and lower systematic error and random error for the case of slip boundary condition. Furthermore, for experimental verification, micro-PIV measurements are conducted over a liquid-gas interface and the single-pixel algorithm is successfully applied to the calculation of near-wall velocity under the slip boundary condition, especially the negative slip velocity. The current work demonstrates the advantage of the single-pixel algorithm in analyzing the complex flow under the slip boundary condition, such as drag reduction, wall skin friction evaluation and near-wall vortex structure measurement.