Skip to main content

Stitch-by-stitch sampling

Look around, then copy what the book did

In plain words

The gap is filled from its edges inward. For each empty stitch the computer looks at the stitches already decided around it, then searches the book for every spot whose surroundings look the same. It picks one of the best-matching spots and copies the stitch the book has in the middle.

Because each new stitch is decided by its neighbours, shapes from the motifs grow outward into the gap and continue naturally. Near the left motif it searches that motif’s manuscript; nearer the right motif it gradually switches to the right one’s.

This is the method usually credited to Efros and Leung (1999).

The settings

Window size is how far around each stitch the computer looks: a small window only sees the immediate neighbours, a larger one recognises bigger shapes.

Tolerance decides whether it must copy from the best-matching spots only, or may also use spots that differ by a few stitches. More tolerance makes the fill looser and more surprising.

The banner

Good at, weak at

Good at Weak at
Closest to the book’s texture in our measurements Tends to extend the neighbouring motif rather than invent a new figure
Fills look solid and continuous

Sources

The papers behind this page. Where a free copy exists (author page, arXiv, university repository), the link goes there.

Efros, Alexei A., and Thomas K. Leung. 1999. “Texture Synthesis by Non-Parametric Sampling.” Proceedings of the IEEE International Conference on Computer Vision (ICCV), 1033–38. https://people.eecs.berkeley.edu/~efros/research/EfrosLeung.html.
Paget, Rupert, and I. Dennis Longstaff. 1998. “Texture Synthesis via a Noncausal Nonparametric Multiscale Markov Random Field.” IEEE Transactions on Image Processing 7 (6): 925–31.
Wei, Li-Yi, and Marc Levoy. 2000. “Fast Texture Synthesis Using Tree-Structured Vector Quantization.” Proceedings of SIGGRAPH 2000, 479–88. https://graphics.stanford.edu/papers/texture-synthesis-sig00/.

Background reading: Texture synthesis (Wikipedia) · Markov random field (Wikipedia)