Binary Shape Vectorization by Affine Scale-space

Yuchen He, Sung Ha Kang, Jean-Michel Morel

Abstract

This paper presents a novel algorithm for converting binary raster images into scalable vector graphics (SVG) using affine scale-space theory. By identifying curvature extrema across multiple scales, the method produces compact and accurate vectorizations, significantly outperforming industry standards in terms of control point efficiency.

Introduction

Vectorization is the process of converting pixel-based raster images into mathematical curves, allowing for infinite scaling without quality loss. However, standard tools often struggle to distinguish between noise and actual features, frequently resulting in either over-smoothed details or an excessive number of control points. This paper introduces a method rooted in differential geometry to create a "compact" representation that maintains high geometric fidelity with minimal data.

Methodology

The proposed pipeline consists of three primary stages:

  1. Sub-pixel Curvature Localization: The algorithm uses bilinear interpolation to define a smooth level line from the raster grid. To mitigate the "staircase" effect of pixels, an affine shortening flow—a geometric partial differential equation—is applied to smooth the curve while preserving its core structure.
  2. Affine Scale-space Tracing: This core innovation involves analyzing the shape at multiple scales. Curvature extrema (corners) are identified at a coarse scale and backpropagated to the fine scale. Features that persist across these scales are designated as "complete points," ensuring they are robust geometric features rather than noise artifacts.
  3. Adaptive Bézier Fitting: Segments between identified control points are fitted with cubic Bézier curves. If the approximation error exceeds a threshold, additional points are adaptively inserted.
Overview of the vectorization process: (a) input silhouette, (b) pixel detail, (c-d) affine scale-space tracing of curvature extrema, (e-f) identification of control points, (g-h) final vector result.

Evaluation and Results

The algorithm was tested on the SVG SILH dataset, featuring diverse silhouettes such as animals, symbols, and complex word clouds.

Performance Metrics

  • Compactness: The method achieved a Mean Relative Reduction (MRR) of 67.38% in control points, compared to 45.79% for Adobe Illustrator 2020.
  • Efficiency: For a complex word cloud (1934 × 1332 pixels), the algorithm achieved an 80.35% compression ratio and a processing time of 0.83 seconds.
  • Visual Fidelity: Qualitative analysis demonstrates superior preservation of sharp corners and smooth transitions compared to commercial alternatives like Vector Magic and Inkscape.

Discussion

The use of scale-space as a filter allows the algorithm to prioritize mathematically meaningful features. By requiring features to exist across a sequence of scales, the method effectively ignores false corners created by the pixel grid.

Limitations and Future Work

The current implementation is limited to binary shapes and may require parameter tuning for extremely noisy images. Future work could extend the method to multi-colored images and more complex topologies, such as self-intersecting boundaries or extremely thin features.

Summary updated

BibTeX
@article{he2023binary,
  author = {Yuchen He and Sung Ha Kang and Jean-Michel Morel},
  title = {{Binary Shape Vectorization by Affine Scale-space}},
  journal = {Image Process. Line},
  year = {2023},
  doi = {10.5201/ipol.2023.401},
}
Figure