Abstract
This paper introduces a novel framework for converting raster images into clean, layer-wise vector graphics that support complex radial gradient fills. By using a "segmentation-guided" approach, the system identifies logical object boundaries and optimizes gradient parameters using a differentiable renderer. This method produces high-quality, editable SVGs with significantly fewer paths than previous state-of-the-art methods, effectively capturing smooth color transitions without the "staircase" artifacts typical of solid-color approximations.
Introduction
Vectorization—the process of turning a pixel-based image into mathematical paths—is essential for graphic design because vector images are infinitely scalable and easy to edit. However, traditional automated tools often produce a "mess" of thousands of tiny, non-overlapping solid-colored shapes.
While recent deep learning approaches have improved the "layer-wise" hierarchy (making the output more intuitive for humans to edit), they struggle with gradients. To mimic a smooth color transition, these tools often stack dozens of solid-colored layers, resulting in bloated files and poor visual fidelity. The core challenge is that optimizing gradient parameters (center, radius, and color stops) is much more complex than picking a single RGBA color, especially when trying to determine which pixels should contribute to which gradient.
Methods
The authors propose a progressive, model-free framework that adds vector paths one by one (or in small batches) and optimizes them using a differentiable renderer (DiffVG).
The key innovations include:
- Gradient-aware Segmentation: Instead of simple color clustering, the method uses a 2D Laplacian filter to detect the "secondary spatial gradient." This helps identify the boundaries where one gradient fill ends and another begins. They use Otsu’s method to dynamically calculate thresholds, allowing the system to focus on large shapes first and smaller details later.
- Segmentation-guided Initialization: New paths are initialized as Bézier circles placed at the center of mass of the region with the highest remaining error. The diameter and initial colors are derived directly from the segmented region.
- Novel Loss Function ($L_{SG}$): Standard loss functions (like Mean Squared Error) often fail because they don't know which pixels "belong" to a specific layer. The authors introduce a segmentation-guided weight. This weight tells the optimizer to focus on pixels within the current segment while ignoring pixels that are occluded by other objects (like eyes on a face), preventing "color bleeding" during optimization.
Datasets
The framework is "model-free," meaning it doesn't require a training phase. However, the authors evaluated it using three distinct datasets:
- Noto Emoji: 256 emojis from Google’s Noto collection (Unicode 15.0), which feature clean hierarchies and gradients.
- Fluent Emoji: 256 colorful emojis from Microsoft, known for rich, complex gradient details.
- Iconfont: 128 detailed vector illustrations. These are complex and mostly solid-colored, used to test if the method holds up even without gradients.
Key Insights and Ideas
- Gradients as Segments: The authors realized that a smooth color transition usually happens within a single logical object. By treating segmentation and vectorization as intertwined tasks, they can "mask" the optimization process to only look at relevant pixels.
- Dynamic Thresholding is Key: As a vector image is built, the "error" (difference from the original) decreases. A fixed segmentation threshold would stop working halfway through. By using Otsu’s method at every step, the algorithm "zooms in" on finer details as the major components are finished.
- Hierarchy over Complexity: By supporting radial gradients, a single path can do the work of 10+ solid paths. This preserves the "topology" of the image, making the final SVG much more useful for a human designer.
Key Results
- Visual Quality: The method produces much smoother results on faces and rounded objects compared to the baseline (LIVE). It avoids the "staircase" effect seen when solid colors try to approximate a gradient.
- Efficiency: The system achieves higher PSNR (Peak Signal-to-Noise Ratio) with fewer paths. For example, it can reconstruct complex facial features with just 6–8 paths where previous methods required dozens.
- User Preference: In a study of 223 participants (4,460 total votes), users significantly preferred the authors' method over the state-of-the-art, particularly on the gradient-heavy Fluent Emoji dataset (65.3% preference).
Limitations and Future Work
- Intricate Contours: The current implementation uses a simple loop of four Bézier curves for initialization. This struggles to fit very "wiggly" or intricate shapes (like dripping liquid) without adding many extra paths to mask the overflows.
- Gradient Types: The study focused primarily on radial gradients with two color stops. The authors note that future versions could dynamically choose between linear and radial gradients and support more color stops for even higher fidelity.
- Optimization Speed: Like most methods using differentiable rendering, the process is iterative and can be computationally expensive compared to non-optimization-based heuristics.
Summary updated