This article describes a mechanism that segments an image by optimizing a homogeneity measure in a level-set formulation. The mechanism has uniform treatment toward texture, gray level, and color boundaries. The mechanism commences by quantizing the entire range of intensity values into a finite number of classes, thereby approximating the image as a class map, in which each image position carries a particular class label. For any region, each class label in it generally appears in a number of positions, which together define the spread-size of the class label in the region. The average spread-size of the class labels in a region, as a ratio to the region size, then constitutes a measure of how homogeneous the region is. The segmentation problem can be formulated as the optimization of such a measure of all the segmented regions. This work contributes chiefly by expressing the above optimization functional in such a way that the optimization can be conducted in a variational formulation, and that the solution can be reached by the deformation of an active contour. In addition, this work incorporates an additional geodesic term into the optimization functional, which maintains the contour's mobility at certain adverse conditions.