AI Glossary / Computer vision and multimodal AI / Intermediate

Efros - Leung texture synthesis

Definition

Efros - Leung texture synthesis is an example-based method that grows a new texture image one pixel at a time using a supplied texture sample. For each new location, it finds similar known neighborhoods in the sample and selects a corresponding pixel value. The method aims to reproduce local texture structure without fitting a fixed parametric texture model.

What it means

A small photograph of pebbles, fabric, or another repeated surface contains examples of how neighboring pixels relate. The method uses those local arrangements to generate a larger image with a similar visual character.

Instead of copying the sample as a regularly repeated tile, it chooses new pixels according to neighborhoods that resemble the context already synthesized. Random selection among acceptable matches allows variation while preserving local compatibility.

The 1999 method by Alexei Efros and Thomas Leung is a foundational example of nonparametric texture synthesis. It does not require a modern generative neural network. Its success depends on whether the sample and neighborhood size capture the structures needed to make the new texture look coherent.

How it works

Begin with a small seed and an output region to fill. Select an unfilled location adjacent to already known pixels so there is some context to compare.

Take a neighborhood around that location and mark which positions are known. Search the source sample for neighborhoods whose corresponding known positions look similar, commonly using a weighted difference measure.

Collect candidate matches with errors sufficiently close to the best available match. Randomly choose a candidate and copy its center pixel value into the new output location. The neighborhood guides the choice; the whole matching patch is not necessarily pasted into the output.

Continue growing the image until the required region is filled. Neighborhood size, matching tolerance, growth order, and search cost all influence the outcome. Small neighborhoods can miss larger structure, while large neighborhoods may reduce the number of compatible candidates and increase computation.

Three practical examples

1. Graphics assets: An artist expands a small sample of a roughly stationary surface texture for use in a mockup.

2. Texture research: A researcher studies how local neighborhood size affects the reproduction of repeated visual structure.

3. Image completion experiments: A prototype fills a texture-like missing region using surrounding evidence and a suitable exemplar, while acknowledging that the result is synthesized.

Think of it this way

Think of completing a patterned mosaic by searching a reference mosaic for places whose surrounding tiles resemble the unfinished area. You choose the tile found at the center of one compatible reference neighborhood.

The analogy has limits because the method compares numerical pixel neighborhoods, often with weighted errors, and does not understand what the texture represents. Matching local tiles also does not guarantee that a large global pattern will line up correctly.

Worked example

Suppose a missing pixel has two known neighboring values, 10 and 20. For a simplified unweighted comparison, three source neighborhoods have corresponding known values (11, 19), (10, 23), and (14, 18).

Their squared-difference errors are respectively (11 - 10) squared + (19 - 20) squared = 2; 0 squared + 3 squared = 9; and 4 squared + (-2) squared = 20.

If this teaching example accepts candidates with error at most 10, the first two qualify. Suppose their center values are 30 and 35. The algorithm can choose one of those center values, allowing variation while using the existing context.

The original method uses a more specific weighted neighborhood comparison and a tolerance relative to matching quality; this absolute threshold is only a transparent illustration. Also, choosing 30 or 35 does not prove that either is the unique correct missing value. Texture synthesis seeks a plausible continuation consistent with sampled local patterns.

Illustrative case study

Fictional case study: FabricPatch enlarges a small scanned fabric sample for a design preview. With a small neighborhood, the output retains local color variation but breaks the longer woven pattern.

The team increases the neighborhood size and compares the result with several source samples. Larger neighborhoods preserve more structure in some cases but also make matching slower and reduce variety.

It labels the result as a synthesized preview rather than a photograph of an actual finished material. This fictional case illustrates the relationship between local context and larger texture structure; it does not claim that the method reproduces every weave or maintains exact manufacturing properties.

Common misconceptions and mistakes

Do not confuse the method with simple tiling. It grows content from matched neighborhoods rather than repeating one unchanged rectangular sample.

Do not confuse pixel-based synthesis with patch-based quilting. Related exemplar methods may copy larger patches, but the classic Efros - Leung procedure grows one pixel at a time.

Do not assume random sampling means arbitrary noise. Candidate selection is constrained by similarity to the already known neighborhood.

Do not expect local matching to guarantee global arrangements. Large symbols, long straight structures, or nonstationary patterns may require information beyond the chosen neighborhood.

Business use

The method is useful as a conceptual foundation for example-based generation and as a baseline in texture experiments. It shows how a relatively simple local rule can create complex-looking output from a sample.

For practical use, examine the source sample's representativeness and the scale of patterns that must remain coherent. Evaluate repetition, seams, broken structures, and computational cost at the intended output size. Keep the distinction between synthesized appearance and observed material clear when previews are used in design discussions or product communication.

People also ask

Does the method train a neural network?

No. The classic approach searches the supplied sample and draws values from matching neighborhoods.

Why use randomness?

Choosing among several acceptable matches can produce variation instead of always following one deterministic continuation.

Can it synthesize any image?

It is designed around texture and local statistical structure; arbitrary scenes with strong global organization can violate those assumptions.

Check your understanding

Why might a larger neighborhood preserve a woven pattern better than a tiny one?

Answer: It includes more of the pattern's spatial relationships in the matching decision. That can help preserve larger structure, although it also makes matching more restrictive and costly.

Related terms

  • Texture synthesis
  • Nonparametric model
  • Markov random field
  • Image quilting
  • exemplar-based generation
  • neighborhood matching
  • image inpainting

Learn next

Learn image quilting next to compare pixel-by-pixel growth with larger patch-based construction. Then explore how neighborhood size and sample diversity affect the balance between local compatibility, global coherence, and output variation.

  • Image quilting

More in Computer vision and multimodal AI

  • Edge-preserving filter - An edge-preserving filter processes an image while trying to avoid blurring important transitions between regions.
  • Edge-preserving smoothing - Edge-preserving smoothing reduces selected image variations while trying to retain meaningful boundaries between regions.
  • Edge-spread function - An edge-spread function, or ESF, describes how an imaging system represents a sharp step boundary as a profile of image values across that boundary.
  • Egocentric vision - Egocentric vision studies visual information captured from the perspective of the person or agent performing an activity.
  • Eigenmoments - Eigenmoments are image descriptors obtained by applying eigenanalysis to a space of geometric image moments.
  • Electronic image stabilization - Electronic image stabilization reduces unwanted apparent camera motion by digitally adjusting captured images or video frames.

Sources

Alexei A. Efros and Thomas K. Leung, Texture Synthesis by Non-parametric Sampling, ICCV 1999: primary paper consulted for neighborhood-conditioned pixel growth and nonparametric sampling. The matching calculation and fictional fabric case are original teaching examples. https://pages.cs.wisc.edu/~dyer/cs534/papers/efros-leung-iccv99.pdf

Previous: Efficiently updatable neural network Next: Egocentric vision

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer