Image inpainting technique has been widely used for reconstructing damaged old photographs and removing unwanted objects from images. In this paper, we introduce an energy function based on object removal inpainting technology. In our system, we use the energy function to measure the quality of the reconstructed region, so a better image completion result is obtained. Several examples and comparisons are given to demonstrate the performing of gradient-based image completion approach.