What is claimed is:1. An image analysis system comprising:one or more data processors; anda non-transitory computer readable storage medium containing instructions which, when executed on the one or more data processors, cause the one or more data processors to perform actions including:obtaining an image of a biological specimen;generating superpixels for the image, wherein the generating comprises grouping pixels of the image into the superpixels;extracting a feature vector from each of the superpixels, wherein the feature vector comprises image features that characterize the superpixel from which the feature vector was extracted;grouping the superpixels into a predefined number of clusters based on the feature vectors extracted from each of the superpixels, wherein each of the clusters is characterized by a centroid vector, which is an approximation of the extracted feature vector from each of the superpixels grouped in the cluster, and the grouping comprises determining that the extracted feature vector from each of the superpixels is closest to the centroid vector of a cluster than to the centroid vector of any other cluster;storing: (i) cluster information identifying the cluster to which each of the superpixels is grouped, and (ii) the centroid vectors of all clusters, as compressed data in a memory; andanalyzing the image based on the compressed data, wherein the analyzing comprises, for each of the superpixels, obtaining the cluster information identifying the cluster to which the superpixel belongs, obtaining the centroid vector of the identified cluster, and using the centroid vector of the identified cluster instead of the feature vector of the superpixel to perform an image processing task.2. The image analysis system of claim 1, wherein:the analyzing further comprises: constructing a graph based at least on the compressed data,adjacent nodes in the graph correspond to adjacent superpixels in the image of the biological specimen and the adjacent nodes are connected by a weighted edge,the weighted edge has a weight corresponding to a distance between clusters to which the adjacent superpixels belong, andthe image processing task is performed as a graph-based image processing task using the graph.3. The image analysis system of claim 2, wherein the graph-based image processing task comprises a segmentation operation that groups the plurality of superpixels into a plurality of segments.4. The image analysis system of claim 1, wherein the actions further includeprecalculating distances between each two clusters in the predefined number of clusters, wherein the distances between each two clusters is stored with the cluster information and the centroid vectors as the compressed data in the memory, and the analyzing comprises, for each of the superpixels, obtaining the cluster information identifying the cluster to which the superpixel belongs, obtaining the centroid vector of the identified cluster, obtaining the distances associated with the identified cluster, and using: (i) the centroid vector of the identified cluster instead of the feature vector of the superpixel, and (ii) the distances associated with the identified cluster, to perform the image processing task.5. The image analysis system claim 1, wherein the actions further include collecting from a user at least one annotation identifying a plurality of same-segment superpixels in the image of the biological specimen.6. The image analysis system of claim 5, wherein the actions further include determining a set of feature weights associated with the image features based on the at least one annotation.7. The image analysis system of claim 6, wherein the superpixels are grouped into the predefined number of clusters based at least on the set of feature weights.8. A method comprising:obtaining an image of a biological specimen;generating superpixels for the image, wherein the generating comprises grouping pixels of the image into the superpixels;extracting a feature vector from each of the superpixels, wherein the feature vector comprises image features that characterize the superpixel from which the feature vector was extracted;grouping the superpixels into a predefined number of clusters based on the feature vectors extracted from each of the superpixels, wherein each of the clusters is characterized by a centroid vector, which is an approximation of the extracted feature vector from each of the superpixels grouped in the cluster, and the grouping comprises determining that the extracted feature vector from each of the superpixels is closest to the centroid vector of a cluster than to the centroid vector of any other cluster;storing: (i) cluster information identifying the cluster to which each of the superpixels is grouped, and (ii) the centroid vectors of all clusters, as compressed data in a memory; andanalyzing the image based on the compressed data, wherein the analyzing comprises, for each of the superpixels, obtaining the cluster information identifying the cluster to which the superpixel belongs, obtaining the centroid vector of the identified cluster, and using the centroid vector of the identified cluster instead of the feature vector of the superpixel to perform an image processing task.9. The method of claim 8, wherein:the analyzing further comprises constructing a graph based at least on the compressed data,adjacent nodes in the graph correspond to adjacent superpixels in the image of the biological specimen and the adjacent nodes are connected by a weighted edge,the weighted edge has a weight corresponding to a distance between clusters to which the adjacent superpixels belong, andthe image processing task is performed as a graph-based image processing task using the graph.10. The method of claim 9, wherein the graph-based image processing task comprises a segmentation operation that groups the plurality of superpixels into a plurality of segments.11. The method of claim 8, further comprising precalculating distances between each two clusters in the predefined number of clusters, wherein the distances between each two clusters is stored with the cluster information and the centroid vectors as the compressed data in the memory, and the analyzing comprises, for each of the superpixels, obtaining the cluster information identifying the cluster to which the superpixel belongs, obtaining the centroid vector of the identified cluster, obtaining the distances associated with the identified cluster, and using: (i) the centroid vector of the identified cluster instead of the feature vector of the superpixel, and (ii) the distances associated with the identified cluster, to perform the image processing task.12. The method of claim 8, further comprising:collecting from a user at least one annotation identifying a plurality of same-segment superpixels in the image of the biological specimen; anddetermining a set of feature weights associated with the image features based on the at least one annotation,wherein the superpixels are grouped into the predefined number of clusters based at least on the set of feature weights.13. A non-transitory computer-readable memory storing a plurality of instructions executable by one or more processors, the plurality of instructions comprising instructions that when executed by the one or more processors cause the one or more processors to perform processing comprising:obtaining an image of a biological specimen;generating superpixels for the image, wherein the generating comprises grouping pixels of the image into the superpixels;extracting a feature vector from each of the superpixels, wherein the feature vector comprises image features that characterize the superpixel from which the feature vector was extracted;grouping the superpixels into a predefined number of clusters based on the feature vectors extracted from each of the superpixels, wherein each of the clusters is characterized by a centroid vector, which is an approximation of the extracted feature vector from each of the superpixels grouped in the cluster, and the grouping comprises determining that the extracted feature vector from each of the superpixels is closest to the centroid vector of a cluster than to the centroid vector of any other cluster;storing: (i) cluster information identifying the cluster to which each of the superpixels is grouped, and (ii) the centroid vectors of all clusters, as compressed data in a memory; andanalyzing the image based on the compressed data, wherein the analyzing comprises, for each of the superpixels, obtaining the cluster information identifying the cluster to which the superpixel belongs, obtaining the centroid vector of the identified cluster, and using the centroid vector of the identified cluster instead of the feature vector of the superpixel to perform an image processing task.14. The non-transitory computer-readable memory of claim 13, wherein:the analyzing further comprises constructing a graph based at least on the compressed data,adjacent nodes in the graph correspond to adjacent superpixels in the image of the biological specimen and the adjacent nodes are connected by a weighted edge,the weighted edge has a weight corresponding to a distance between clusters to which the adjacent superpixels belong, andthe image processing task is performed as a graph-based image processing task using the graph.15. The non-transitory computer-readable memory of claim 14, wherein the graph-based image processing task comprises a segmentation operation that groups the plurality of superpixels into a plurality of segments.16. The non-transitory computer-readable memory of claim 13, wherein the processing further comprises precalculating distances between each two clusters in the predefined number of clusters, wherein the distances between each two clusters is stored with the cluster information and the centroid vectors as the compressed data in the memory, and the analyzing comprises, for each of the superpixels, obtaining the cluster information identifying the cluster to which the superpixel belongs, obtaining the centroid vector of the identified cluster, obtaining the distances associated with the identified cluster, and using: (i) the centroid vector of the identified cluster instead of the feature vector of the superpixel, and (ii) the distances associated with the identified cluster, to perform the image processing task.17. The non-transitory computer-readable memory of claim 13, wherein the processing further comprises:collecting from a user at least one annotation identifying a plurality of same-segment superpixels in the image of the biological specimen; anddetermining a set of feature weights associated with the image features based on the at least one annotation,wherein the superpixels are grouped into the predefined number of clusters based at least on the set of feature weights.