1. A method for synthesizing a texture sample from an input texture, comprising steps for: receiving an input texture comprising a set of pixels forming an image; pre-processing the input texture to determine a number of pixel clusters and to identify cluster centers for each cluster; setting a size for an output texture compaction; initializing pixel values of the output texture compaction using pixels selected from random neighborhoods of the input texture, where each neighborhood represents immediate spatial neighbors of each pixel of the input texture; iteratively minimizing an inverse energy function that measures a similarity between each neighborhood of the input texture and a corresponding best matching neighborhood from the output texture compaction to ensure that each neighborhood of the input texture has a presence in the output texture compaction by iteratively assigning pixels from neighborhoods of the input texture to the output texture compaction; and outputting an optimized texture compaction that represents a texture sample of the input texture after the inverse energy function has been iteratively minimized.