1. A computer-implemented method of processing an image, the method comprising: at an input, receiving an image to be processed; obtaining details of a seed region in the image; arranging at least one processor to create and store a data structure in memory holding a tree-based representation of the image which is related to geodesic distances of image elements in the image from the seed region.