1. A system, comprising: one or more processors; and a memory coupled to the one or more processors and storing program instructions executable by the one or more processors to implement: dividing an input image into a plurality of patches in accordance with a regular grid; for each of the plurality of patches: determining a set of candidate patches from among the plurality of patches for placing adjacent to the patch, wherein the set of candidate patches comprises less than all of the plurality of patches; and for each candidate patch: determining one or more groupings of compatible neighbor patches for the candidate patch, wherein each grouping comprises the candidate patch and one or more other patches, and wherein the patches in each grouping are compatible with each other when placed in a particular spatial configuration with respect to the candidate patch and each other; and for each of one or more of the one or more groupings: storing active labels identifying the compatible neighbor patches that are included in the determined grouping; and subsequent to said storing, performing an image editing operation on the input image to produce an output image, wherein the location of at least some of the plurality of patches within the output image is dependent on the stored active labels.