a digital holographic phase reconstruction algorithm via the patch-based image inpainting method is proposed in this paper. The algorithm can eliminate system aberrations in the off-axis DHM, including the tilt and spherical aberration. By using a mask to cover the sample interference fringes and restoring the sample region with the single source patch-based synthesis algorithm, all the system aberrations are fitted and effectively compensated. The results in simulation and experiment reveal that the proposed method can achieve high compensation accuracy and robustness.