While the image was sewed in cloth with thread or was made a physical model by 3D printer, the colors of the thread or the material of the 3D printer was limit, to simplify the manufacture processing. Although the conventional image clustering algorithm can segment the image into seldom clusters and give each cluster a specific color that decrease most colors and preserver the main feature. However the contour will be cluster in many clusters induce by the color gradient of the contour. This paper proposed a clustering algorithm based on involved spatial distance to assign the contour a consistent color. The experimental shown that the proposed algorithm had cluster quality more than 90%, the maximum improvement was 57% that com-pared with the conventional clustering algorithm.