Introduction
Image vectorization—the process of converting raster pixels into mathematical paths—is a cornerstone of digital design. Unlike raster images, vector graphics are infinitely scalable and easily editable. However, traditional vectorization tools often fail to capture the underlying structure of an image. They typically produce a "what you see is all you get" result, where objects are represented as fragmented paths rather than complete, overlapping shapes. For instance, if a tree trunk is partially obscured by a bush, standard vectorizers treat the trunk as two disconnected segments.
This lack of layer awareness significantly hinders professional workflows. To create a truly editable vector file, a system must understand occlusion and "hallucinate" the hidden portions of objects to reconstruct semantically coherent, fully-formed layers. LayerPeeler addresses this challenge through a novel "autoregressive peeling" strategy that iteratively identifies and removes the topmost layers of an image to reveal what lies beneath.
Methodology: The Peeling Paradigm
LayerPeeler moves away from simultaneous multi-layer optimization, instead adopting a progressive simplification approach. The process operates in an autoregressive loop consisting of four primary stages:
1. Layer Graph Construction
While Vision-Language Models (VLMs) often struggle with direct object detection in abstract or stylized graphics, they excel at relational reasoning. LayerPeeler prompts a VLM to construct a Layer Graph, where nodes represent flat-color regions and edges define "occludes" or "interrupted shape" relationships. By focusing on pairwise checks (e.g., "Is Object A in front of Object B?"), the system builds a robust structural map of the image.
2. Top-Layer Identification and Captioning
Using the Layer Graph, the system identifies the non-occluded elements—the "top" layers. It then generates descriptive instructions for their removal, such as "remove the green leaves."
3. Diffusion-Based Peeling
The image and the removal instruction are processed by a fine-tuned FLUX.1-dev diffusion model. This model acts as a generative prior, "peeling" away the identified layer and inpainting the revealed background. To ensure the peeling is surgically precise and does not inadvertently alter unrelated parts of the image, the authors implement a Localized Attention Control mechanism using spatial masks.
4. Vector Extraction
By calculating the difference between the image before and after the peeling step, the system extracts the specific shape of the removed layer. This shape is then converted into a vector path using standard off-the-shelf tools. This loop repeats until the entire image is decomposed into a stack of clean, overlapping vector layers.
The LayerPeeler Dataset
To train this pipeline, the authors introduced the LayerPeeler Dataset, a large-scale collection designed specifically for layer-wise tasks. It contains:
- 179,000 colored SVGs sourced from SVGRepo and Iconfont.
- 617,000 high-quality training triplets, each consisting of the original image, an editing prompt, and the resulting image with the top layer removed.
Unlike previous datasets that focused on simple icons, this collection includes complex occlusion relationships and detailed semantic annotations, providing the necessary depth for training generative reconstruction models.
Key Results and Insights
LayerPeeler was evaluated against state-of-the-art baselines, including IVD, LIVE, and LayerTracer. The results demonstrate a significant leap in both geometric and semantic quality:
- Path Irregularity: LayerPeeler achieved a score of 25.41 (lower is better), vastly outperforming the next best baseline, IVD (69.17). This indicates that the generated paths are smoother and more representative of human-designed vectors.
- Path Semantics: Using CLIP-based similarity drops to measure how well the extracted layers represent distinct semantic objects, LayerPeeler scored 0.0242, nearly doubling the performance of most optimization-based methods.
- Qualitative Impact: In user studies, participants consistently preferred LayerPeeler for its "structural coherence." When layers are moved or edited, they behave logically because the system has correctly reconstructed the occluded regions.
Limitations and Future Work
Despite its success, LayerPeeler faces several challenges:
- Semi-Transparency: The model is currently optimized for flat-color SVGs and struggles with semi-transparent elements (like glass or water), which it may fragment into multiple discrete shapes.
- Error Accumulation: As an autoregressive process, a mistake in an early "peel"—such as a VLM misidentifying a layer—can propagate through the sequence, leading to missing or redundant paths.
- Photorealism: The system is currently less effective on natural photographs due to a lack of ground-truth "peeling" data for real-world scenes. Future work may involve using data augmentation, such as adding gradients, to bridge the gap between stylized graphics and photorealistic images.
Conclusion
LayerPeeler represents a shift in image vectorization from simple edge detection to deep structural understanding. By leveraging the reasoning of VLMs and the generative power of diffusion models, it provides a path toward fully automated, professional-grade vector reconstruction that respects the layered nature of visual art.
Summary updated