1. A system comprising: one or more modules implemented at least partially in hardware, the one or more modules configured to perform operations comprising: grouping a plurality of patches taken from a plurality of training samples of images into respective ones of a plurality of partitions; calculating an image processing operator for each of the partitions; determining distances between the plurality of partitions that describe image similarity of patches of the plurality of partitions, one to another; and configuring a database to provide the determined distance and the image processing operator to process an image in response to identification of a respective said partition that corresponds to a patch taken from the image.