Stroke-based Rendering: From Heuristics to Deep Learning

Florian Nolte, Andrew Melnik, Helge RitterarXiv 2022

This survey paper by Florian Nolte, Andrew Melnik, and Helge Ritter provides a comprehensive look at Stroke-based Rendering (SBR)—the art of teaching machines to paint not pixel-by-pixel, but stroke-by-stroke. While most modern generative AI (like Stable Diffusion or Midjourney) operates in the "pixel space," SBR mimics the human artistic process by layering parameterized shapes, offering a more structured, editable, and vector-friendly approach to digital art.

TL;DR

This survey bridges the gap between classical computer graphics heuristics and modern deep learning, categorizing how algorithms decide to place strokes to recreate or stylize images. It highlights the shift from simple edge-following rules to sophisticated Reinforcement Learning agents that "plan" their paintings using differentiable rendering.

What Problem Does This Paper Address?

Most deep learning models for image generation (GANs, VAEs, Diffusion) predict the values of every pixel in a raster grid. While effective, this is fundamentally different from how humans create art. Humans plan sequences of strokes, considering shape, color, and layering.

Pixel-based generation lacks the inherent "semantic" structure of a painting. It is difficult to scale to infinite resolutions without blurring, and it doesn't provide the "vector-like" editability that artists need. SBR addresses this by treating image generation as a sequence of decisions about discrete primitives (lines, curves, polygons). The core challenge is the inverse problem: given a target image, what sequence of stroke parameters (position, color, width, curvature) will best reconstruct it?

Methods

The authors propose a taxonomy that divides SBR into two main philosophies: Greedy Heuristics and Error Minimization.

Fig. 5. Taxonomy of stroke-based painterly rendering algorithms.

1. Greedy Heuristics

These are "bottom-up" approaches that use hand-crafted rules to place strokes in a single pass.

  • Edge Alignment: Algorithms detect low-level pixel edges (using Sobel or Canny filters) or high-level object contours to orient strokes so they follow the image structure.
  • Region Approximation: These use image segmentation or "image moments" to find homogeneous color areas and replace them with matching brushstrokes.

2. Error Minimization

These "top-down" approaches view painting as an optimization problem, trying to minimize the difference between the rendered canvas and a target image.

  • Iterative Optimization: Techniques like genetic algorithms or hill-climbing randomly perturb stroke parameters and keep changes that reduce error.
  • Gradient-Based Optimization: This requires Differentiable Rendering. Because traditional rasterization is non-differentiable, researchers use hand-crafted differentiable functions or train Neural Renderers (neural networks that approximate the rendering process) to allow gradients to flow from the loss function back to the stroke parameters.
Fig. 3. A neural renderer can be trained to imitate non-differentiable rendering engines. Different neural architectures and losses can be used during training [43].

3. Deep Learning Agents

The most recent frontier involves training Deep Reinforcement Learning (DRL) agents. These agents observe the current state of the canvas and the target image to predict the "next best action" (the next stroke).

Datasets

While many SBR methods are self-supervised (optimizing against a single target image), several datasets are used for training and benchmarking:

  • QuickDraw: A large vector-based dataset of simple doodles used for training recurrent models like sketch-rnn.
  • CUB-200 Birds: Frequently used to evaluate how well DRL agents can reconstruct specific object categories.
  • CelebA-HQ: Used for training agents to perform unconditional generation (creating new faces from scratch in a painterly style).
  • ImageNet: Used to pre-train the "critics" (classifiers) that provide perceptual loss signals to the painting models.

Key Insights and Ideas

  • The Power of Differentiability: The shift to differentiable rendering is the "bridge" that allowed SBR to join the deep learning revolution. It transforms painting from a search problem into an optimization problem.
  • Planning vs. Greed: A major "aha" moment in DRL research is that agents can learn to place "ugly" or low-reward early strokes (like a dark background layer) that enable much higher rewards later in the sequence. Simple greedy algorithms often get stuck in local optima because they only care about the immediate improvement of the next stroke.
Fig. 4. Painting process of an SBR algorithm [10] that uses a neural ren- dering approximation (top row) to calculate parameters of strokes. The strokes are placed one after another on the canvas (left to right). Once all stroke parameters have been calculated, the neural approximation can be replaced by the ground truth strokes (bottom). This is useful if the neural renderer is not able to capture all details of the underlying stroke model.
  • Loss Function Sensitivity: The choice of loss (L1 vs. Perceptual vs. CLIP) drastically changes the output. Perceptual losses (based on deep features) tend to preserve structure and "vibe" even if colors don't match perfectly, while CLIP losses allow for abstract text-to-drawing synthesis.
  • Stroke Models Matter: The choice of primitive—whether it's a simple ellipse, a complex B-spline curve, or a polygon—defines the "vocabulary" of the AI artist and heavily influences the final aesthetic.
Fig. 2. There are many different possibilities to choose the parameters and appearance of strokes. Once stroke parameters have been chosen, the vector shapes can be rasterized into an arbitrarily sized pixel image.

Key Results

  • Efficiency: Trained DRL agents and Transformers (like Paint Transformer) can predict stroke sequences in near real-time, whereas iterative optimization can take minutes or hours per image.
  • Stylization: SBR naturally excels at style transfer. By restricting the stroke model (e.g., using only "marker pen" or "watercolor" textures), the model is forced to interpret the content through that specific medium.
  • Video Coherence: By using optical flow to move strokes between frames, SBR can produce painterly animations that avoid the "flickering" artifacts common in pixel-based video stylization.

Limitations and Future Work

  • Generalization: Many models struggle to generalize outside their training domain (e.g., a model trained on birds might fail to paint a landscape).
  • Complexity vs. Speed: Reconstructing highly detailed textures requires thousands of strokes, which increases the computational cost of both optimization and rendering.
  • Human-AI Collaboration: The authors suggest that future work should focus on how these automated agents can interactively support human artists in digital painting programs, rather than just replacing the process.
  • Expanding Styles: The survey notes a need to extend these methods to more diverse styles like sketching, cross-hatching, and pen-and-ink illustrations.

Summary updated

BibTeX
@misc{nolte2022stroke,
  author = {Florian Nolte and Andrew Melnik and Helge Ritter},
  title = {{Stroke-based Rendering: From Heuristics to Deep Learning}},
  year = {2022},
  eprint = {2302.00595},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.00595},
}
Figure