Towards Layer-wise Image Vectorization

Xu Ma, Yuqian Zhou, Xingqian Xu, Bin Sun, Valerii Filev, Nikita Orlov, Yun Fu, Humphrey Shi

TL;DR

LIVE (Layer-wise Image VEctorization) is a new framework that converts raster images into SVGs by progressively adding and optimizing Bézier paths one layer at a time. By prioritizing topological structure over simple pixel-matching, it generates compact, human-editable vector graphics that generalize far better than previous deep learning-based approaches.

What Problem Does This Paper Address?

While turning a vector graphic into pixels (rasterization) is a solved problem, the reverse—vectorization—remains a significant challenge in computer graphics.

Existing deep learning models for vectorization often struggle with "out-of-domain" data (images unlike their training sets) and frequently produce a "soup" of redundant, overlapping shapes. These outputs lack a logical, layer-wise structure, making them nearly impossible for a human designer to edit. The authors identify a core issue: most models focus solely on minimizing pixel-wise error (like Mean Squared Error), which ignores the underlying topology—the way shapes are naturally stacked and organized in an image.

Methods

LIVE moves away from end-to-end neural networks in favor of a progressive optimization framework. It starts with an empty canvas and iteratively adds new Bézier paths to reconstruct the target image from coarse to fine details.

Key innovations include:

  • Component-wise Path Initialization: Instead of random placement, LIVE calculates the difference between the current render and the target image. it identifies the largest "missing" or incorrectly colored component and initializes the next path at its center of mass.
  • Unsigned Distance guided Focal (UDF) Loss: Standard MSE loss often causes paths to adopt the "mean color" of the entire image. UDF loss weights pixels based on their distance to the path's contour, forcing the optimization to focus on sharp edges and accurate local coloring.
  • Self-Crossing (Xing) Loss: To prevent Bézier paths from becoming "tangled" or self-intersecting (which creates messy geometry), the authors introduced a geometric constraint on the control points to keep shapes simple and prone to convexity.
The UDF loss prevents the "color mean" issue seen in standard MSE optimization.

Datasets

The authors evaluated LIVE on two primary datasets:

  1. Emoji Dataset: 134 diverse emojis from the NotoEmoji project, used to test how well the model captures clear, simple topological structures.
  2. Pics Dataset: A new collection of 153 complex images, including fonts, icons, and cliparts with varied backgrounds, designed to test the limits of layer-wise modeling.

Key Insights and Ideas

  • Topology > Pixels: The "aha moment" is that minimizing pixel error isn't enough for good vectorization. By focusing on the contours (via UDF loss) and geometry (via Xing loss), the model discovers a more natural representation.
  • Human-Centric Structure: Because LIVE adds paths progressively, the resulting SVG has a deterministic order that mimics how a human might draw—placing large background shapes first and fine details last.
  • Model-Free Generalization: Unlike many recent works, LIVE doesn't require a massive pre-trained transformer or GAN. This allows it to work on virtually any image type, from simple icons to complex natural photographs, without retraining.
Comparison of self-intersecting paths vs. clean paths optimized with Xing loss.

Key Results

LIVE significantly outperforms prior state-of-the-art methods like DiffVG and Im2Vec in both efficiency and quality:

  • Compactness: LIVE achieves a much lower MSE using significantly fewer paths. For example, on the Emoji dataset, LIVE reaches a high level of fidelity with just 8-16 paths, whereas other methods still show artifacts at higher path counts.
  • Visual Fidelity: Qualitatively, LIVE produces cleaner shapes that better decouple different image components (e.g., eyes vs. face).
  • Downstream Utility: The ordered nature of LIVE’s paths makes it trivial to perform linear interpolation between two different vector images, resulting in smooth, semantically meaningful transitions.
Quantitative results showing LIVE achieves lower error with fewer paths compared to DiffVG.

Limitations and Future Work

While LIVE represents a major step forward, the authors note several areas for improvement:

  • Efficiency: The iterative, optimization-based approach is slower than a single-pass neural network inference.
  • Color Complexity: The current implementation focuses on solid-filled paths. Adding support for linear and radial gradients would greatly enhance its ability to represent complex artwork.
  • Amodal Understanding: For very complex natural scenes, the authors suggest that combining LIVE with deep amodal segmentation (understanding what parts of an object are hidden behind another) could lead to even more realistic layer-wise decompositions.

Summary updated

BibTeX
@misc{ma2022towards,
  author = {Xu Ma and Yuqian Zhou and Xingqian Xu and Bin Sun and Valerii Filev and Nikita Orlov and Yun Fu and Humphrey Shi},
  title = {{Towards Layer-wise Image Vectorization}},
  year = {2022},
  eprint = {2206.04655},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.04655},
}
Figure