1. A computer implemented method of image segmentation, in which the pixels of the image are represented by the vertices of a graph, the adjacency of pixels is represented by the edges of the graph, the edges are assigned, using a data processor, weights representing a measure of dissimilarity between adjacent pixels, a minimum spanning tree of the graph (or an approximation thereto) is generated using the data processor, and edges are removed successively using the data processor from the minimum spanning tree to create a spanning forest, the trees of which correspond to segments of the image, wherein the selection of an edge for removal from the spanning forest depends on a measure of distance from the edge to leaves of the tree in which the edge resides.