1. A method comprising: obtaining, by a computing device and from a storage, example image patches that are taken from example images external to an input image, the storage including a plurality of partitions of the example image patches, the example image patches in a partition being similar one to another; assigning, by the computing device, at least one first patch taken from the input image as being associated with a partition of the plurality of partitions, the assigning based on a similarity of the at least one first patch to the example image patches in the partition; obtaining, by the computing device and from the storage, a first image processing operator associated with the partition based on the example image patches in the partition; determining, by the computing device, that at least one second patch taken from the input image does not correspond to any partition of the plurality of partitions; generating, by the computing device and responsive to the determining, a second image processing operator based on the at least one second patch and at least one additional patch taken internally from the input image; and generating, by the computing device, an output image by applying the first image processing operator to the at least one first patch and applying the second image processing operator to the at least one second patch and the at least one additional patch.