General algorithms of contour tracing are just for binary image, and fail in some complicated images. These algorithms are correct just in some ordinary cases. The reasons of failing are always the lack of theory and the pixel is not enough for contour tracing. The theory of crack brought by A.Rosenfeld is very useful for contour tracing. But the crack is not intuitionistic. So, a new pixel-based algorithm of contour tracing for multi-value segmented image is presented by using the character of crack. After analyzing all cases that maybe occur in contour tracing, this paper summarized a succinct theory. As we know, the contours maybe superpose and intersect, so the same pixel maybe occurs several times in contour tracing, but the corresponding crack is unique, if we find the crack, then the corresponding pixel is found. That is the idea of the paper. The new algorithm is easy and accurate compared the traditional algorithms. In addition, this paper analyzed all relations that maybe occur between regions, pointed a effective algorithm of analyzing the inclusion relations among the regions to build the tree structure. The former algorithms fail in analyzing the tree structure of multi-value segmented image, but the algorithm is effective in all case. Experiments show that these algorithms are correct and high-effective.