In this study, we first studied several inpainting algorithms. Inpainting algorithms based PDE (Partial Differential Equation) preserve the construction very well, but time consuming. We propose a new inpainting algorithm for cartoon based on color segmentation to preserve the structure of image. After trying several different ways to find the map of contour lines, we use color segmentation to construct the map of contour lines, and use the law of cosine to estimate the length of contour line we sample. We also estimate the slope of contour lines and compute how they should extend in the inpainting domain. We use the advantage of Bézier curves that fit the curves to the real world to reconstruct the contour lines. The algorithm also fit to more general cases.