The problem of segmenting images of objects with smooth surfaces is considered. Gibbs random fields are used to model the region process. The parameters of the Gibbs random field model the size and the shape of the regions. The intensity of each region is modeled as a slowly varying function plus white Gaussian noise. The technique developed can be regarded as a generalization of the K-means clustering algorithm to include spatial constraints and to account for intensity variations with regions. Spatial constraints are included by the use of the Gibbs model, while local intensity variations are accounted for in an iterative procedure involving averaging over a sliding window whose size decreases as the algorithm progresses. Also presented is a region-merging technique to eliminate spurious boundaries in the output segments. Results with an eight-neighbor Gibbs random field model applied to pictures of industrial objects and degraded optical characters show that the algorithm performs better than the K-means algorithm and its nonadaptive extensions that incorporate spatial constraints by the use of Gibbs random fields.