The fractal dimension is a fascinating feature highly correlated with the human perception of surface roughness, and has been successfully applied to texture analysis, segmentation, and classification. Several approaches have been developed to estimate the fractal dimension. Among them, the box-counting (BC) method is nonstochastic and popular in estimating the fractal dimension of a two-tone image. The differential box-counting (DBC) method, a generalization of the classical BC method, was proposed to compute the fractal dimension for a 2-D gray-level image. However, the classical BC and the DBC methods have several major drawbacks, such as overcounting and undercounting the number of boxes. Hence, the real value of the fractal dimension cannot be reached. In this work, two algorithms that can obtain more accurate estimates of the fractal dimension are proposed. The first one, a modified algorithm of the DBC method, is called the shifting DBC (SDBC) algorithm, and the second one is called the scanning BC (SBC) algorithm. We theoretically prove that the SDBC algorithm approaches the estimated value closer to the exact fractal dimension than the DBC method. Simulation results show that the two proposed algorithms can resolve the drawbacks that the BC and the DBC methods possess. Compared to the DBC method, the two proposed algorithms consistently give more satisfactory results on synthetic and natural textured images.