1. A method, comprising: segmenting an image into image regions; representing each of the image regions by a respective vertex and a respective feature vector of features characterizing the image region; building a graph of the vertices interconnected by edges each of which has a respective edge weight value that depends on a distance between the respective feature vectors of the image regions interconnected by the edge; partitioning the graph into respective disjoint subgraphs based on the edge weight values; repeating the partitioning of one or more of the subgraphs into respective subgraphs; and producing a partition tree data structure that describes a partitioning hierarchy of parent-child relationships between the subgraphs; wherein the segmenting, the representing, the building, the partitioning, the repeating, and the producing are performed by a computer.