StyleBlit: Fast Example-Based Stylization with Local Guidance

Daniel Sýkora, Ondřej Jamriška, Jingwan Lu, Eli ShechtmanarXiv 2018

TL;DR

StyleBlit is a high-performance, example-based style transfer algorithm that achieves state-of-the-art visual quality without the need for computationally expensive optimization. By leveraging "local guidance" channels (like 3D normals or UV coordinates), it delivers real-time stylization on a single-core CPU and over 100 FPS at 4K resolution on a GPU, making it ideal for mobile applications and games.

What Problem Does This Paper Address?

Traditional example-based style transfer—where the look of a source "exemplar" is applied to a target image—usually falls into two camps: neural-based or patch-based. Both typically rely on complex optimization processes to ensure "textural coherence," meaning the synthesized texture looks continuous and sharp rather than a blurry mess.

While these methods produce beautiful results, they are slow. Even "interactive" versions often require high-end GPUs, leaving mobile devices and real-time games out in the cold. The authors of StyleBlit noticed that when strong "local guidance" (descriptive data like surface normals) is available, optimization-based methods naturally converge to a state where they simply copy large, coherent chunks of the source. They asked: if optimization leads to a simple copy-paste mosaic anyway, can we just build that mosaic directly and skip the math-heavy optimization?

Methods

StyleBlit replaces global optimization with a set of efficient, parallelizable pixel-level operations. The core of the approach relies on Local Guidance: descriptive channels (e.g., normal maps, texture coordinates, or displacement fields) that provide a semantically meaningful mapping between the source and target.

The algorithm works through a hierarchical search:

  1. Seed Hierarchy: The target image is populated with an implicit hierarchy of "seeds" (randomly jittered grid points). Top-level seeds are far apart, while lower levels are increasingly dense.
  2. Hierarchical Traversal: For every target pixel, the algorithm starts at the top level and finds the nearest seed. It uses a simple lookup table to find the corresponding location in the source exemplar based on that seed's guidance value.
  3. Threshold Check: If the guidance difference between the target pixel and the source location is below a user-defined threshold, the source color is copied. If not, the algorithm moves to a denser level of seeds and tries again.
  4. Parallelization: Unlike previous sequential patch-based methods, this "ParallelStyleBlit" visits each target pixel exactly once and requires no inter-pixel communication, making it perfectly suited for GPU implementation.
Figure 1: StyleBlit in applications: (a) style transfer from an exemplar in Fig. 5 to a 3D model using StyLit [FJL∗16]; (b) our approach delivers similar visual quality but is several orders of magnitude faster; (c) regular texture mapping using texture presented in Fig. 8 vs. (d) our approach that better preserves visual characteristics of the used artistic media; (e) style transfer to a portrait image using FaceStyle [FJS∗17] with an exemplar in their supplementary material; (f) our approach produces similar visual quality and is notably faster.

Datasets

The paper does not use standard machine learning datasets (like ImageNet). Instead, it evaluates the algorithm using a variety of artistic exemplars and target scenarios:

  • 3D Models: Stylizing 3D renders using normal maps as guidance (comparing against the StyLit algorithm).
  • Portraits: Transferring artistic styles to human faces using displacement fields and facial landmarks (comparing against FaceStyle).
  • Pixel Art: Demonstrating the preservation of sharp, manual details that are often blurred by other methods.
  • Hand-drawn Textures: Using stochastic textures (like pencil hatches or oil strokes) to show how the algorithm hides seams.

Key Insights and Ideas

  • Optimization is Overkill: When guidance is "local" and descriptive (high spatial variation), the energy landscape of the style transfer problem becomes very simple. Optimization-based techniques essentially waste cycles arriving at a solution that a smart lookup could find instantly.
  • Stochastic Masking: The authors lean into the nature of hand-drawn art. Because these styles are often "stochastic" (randomly textured), the human eye is naturally forgiving of small misalignments. This "visual masking" allows StyleBlit to skip expensive blending at chunk boundaries without creating jarring seams.
  • Coherence through Guidance: Textural coherence—the "holy grail" of patch synthesis—is implicitly encouraged by the smoothness of the guidance channels themselves. If the normals of two adjacent pixels are similar, StyleBlit will naturally pick source pixels that are also adjacent.

Key Results

The most striking result is the speedup. StyleBlit is roughly three orders of magnitude faster than previous state-of-the-art methods like StyLit, while maintaining comparable visual quality.

  • Performance:
    • CPU: 10 FPS for a 1-megapixel image on a single-core i7.
  • GPU: >100 FPS at 4K resolution on a GeForce GTX 970.
  • Mobile: 15 FPS full-screen on a mid-range Samsung Galaxy A3.
  • Visual Fidelity: As seen in the comparison below, StyleBlit preserves the high-level structure of artistic media (like large brush strokes) better than simple texture mapping, which often distorts high-frequency details.
Comparison of StyleBlit (left) vs StyLit (middle) and The Lit Sphere (right). StyleBlit matches StyLit's quality at a fraction of the cost.

Limitations and Future Work

While powerful, StyleBlit is not a universal style transfer solution:

  • Regular Textures: It struggles with highly regular, non-stochastic textures (like a clean brick wall). Large features can lead to visible misalignments at chunk boundaries.
  • Guidance Dependency: The method requires a "local guide." If the guidance is too "fuzzy" or constant over large areas, the algorithm may produce repetitive artifacts or fail to preserve style structure.
  • Geometric Mismatches: Significant differences in scale or rotation between the source and target can cause blurring or excessive repetition. The authors suggest pre-rotating source guidance as a potential future fix.

Despite these constraints, StyleBlit represents a major step toward bringing sophisticated artistic stylization to interactive, consumer-level hardware.

Summary updated

BibTeX
@misc{sykora2018styleblit,
  author = {Daniel Sýkora and Ondřej Jamriška and Jingwan Lu and Eli Shechtman},
  title = {{StyleBlit: Fast Example-Based Stylization with Local Guidance}},
  year = {2018},
  eprint = {1807.03249},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.03249},
}
Figure