Abstract
We propose a new color image vectorization method converting raster images to resolution-independent scalable vector graphics. Starting from a quantized raster image, the method builds a hierarchical structure to represent its discontinuity set. The lowest level elements, called curve-elements, separate exactly two colors and end at T-junctions or X-junctions. The middle-level objects, called curvebases, are concatenations of curve-elements following perceptual rules and representing the apparent contours of objects. On the highest level, the jump set coincides with the discontinuity set of the quantized image input. A geometric filtering method removes pixelization effects by affine shortening of the curvebases while resolving the induced topological changes. All junctions are preserved, thus maintaining the highest level of perceptual fidelity even on tiny pixel art images. A single parameter controls the simplification of curves between two junctions. Theoretical bounds are given to guarantee the method’s topological consistency. This allows the method to be iterated such that it yields a smoothing semigroup. In both qualitative and quantitative experiments, our method compares favorably to multiple state-of-the-art algorithms and software.
Similar content being viewed by others
Data Availability
The datasets analyzed for vectorizing photographic images are available in the IPOL demo https://ipolcore.ipol.im/demo/clientApp/demo.html?id=5555531082036. The datasets analyzed for vectorizing pixel art are available in the published articles [10, 24].
Notes
When presenting the results by [19], since the available program only vectorizes the boundaries without correctly rendering the colors, we manually filled in the corresponding colors.
References
Adobe Illustrator. https://www.adobe.com/products/illustrator.html
Álvarez, L., Guichard, F., Lions, P.-L., Morel, J.-M.: Axiomes et équations fondamentales du traitement d’images.(Analyse multiéchelle et edp). Comptes rendus de l’Académie des sciences. Série 1, Mathématique 315, 2, 135–138 (1992)
Angenent, S., Sapiro, G., Tannenbaum, A.: On the affine heat equation for non-convex curves. J. Am. Math. Soc. 11(3), 601–634 (1998)
Bowler, J., Brown, C., Capsimalis, M., Cohn, R., Deweese Cole, L., et al.: Scalable vector graphics (svg) 1.0 specification. World Wide Web Consortium (2001)
Caselles, V., Coll, B., Morel, J.-M.: Scale space versus topographic map for natural images. In International conference on scale-space theories in computer vision. Springer, 29–49 (1997)
Caselles, V., Coll, B., Morel, J.-M.: Topographic maps and local contrast changes in natural images. Int. J. Comput. Vis. 33(1), 5–27 (1999)
Celebi, M.E.: Improving the performance of k-means for color quantization. Image Vis. Comput. 29(4), 260–271 (2011)
Charles, D., Davies, E.R.: Properties of the mode filter when applied to colour images (2003)
Ciomaga, A., Monasse, P., Morel, J.-M.: The image curvature microscope: accurate curvature computation at subpixel resolution. Image Process. Line 7(2017), 197–217 (2017)
Dominici, E.A., Schertler, N., Griffin, J., Hoshyari, S., Sigal, L., Sheffer, A.: PolyFit: perception-aligned vectorization of raster clip-art via intermediate polygonal fitting. ACM TOG 39(4), 77–1 (2020)
Egiazarian, V., Voynov, O., Artemov, A., Volkhonskiy, D., Safin, A., Taktasheva, M., Zorin, D., Burnaev, E.: Deep vectorization of technical drawings. In: European conference on computer vision. Springer, 582–598, (2020)
Freire, A.: Mean curvature motion of triple junctions of graphs in two dimensions. Comm. Partial Differ. Equ. 35(2), 302–327 (2010)
Fuchs, W.: Experimentelle Untersuchungen uber das simultane Hintereinandersehen auf derselben Sehrichtung. Z. Psychol. 91(1923), 145–235 (1923)
Garcke, H., Nestler, B., Stoth, B.: A multiphase field concept: numerical simulations of moving phase boundaries and multiple junctions. SIAM J. Appl. Math. 60(1), 295–315 (1999)
Gervautz, M., Purgathofer, W.: A simple method for color quantization: octree quantization. In: New trends in computer graphics. Springer, 219–231 (1988)
Gibson, L., Lucas, D.: Vectorization of raster images using hierarchical methods. Comput. Graph. 20(1), 82–89 (1982)
He, Y., Kang, S.H., Morel, J.-M.: Silhouette Vectorization by Affine Scale-Space. J. Math. Imag. Vis. 2021, 1–16 (2021)
He, Y., Kang, S. H., Morel, J.-M.: Vectorizing images of any size. In: IEEE International conference on image processing (ICIP). IEEE (2022)
Hoshyari, S., Dominici, E.A., Sheffer, A., Carr, N., Wang, Z., Ceylan, D., Shen, I.-C.: Perception-driven semi-structured boundary vectorization. ACM TOG 37(4), 1–14 (2018)
Inkscape. https://inkscape.org
Jimenez, J., Navalon, J.L.: Some experiments in image vectorization. IBM J. Res. Dev. 26(6), 724–734 (1982)
Kanizsa, G.: Organization in Vision: Essays on Gestalt Perception. Praeger Publishers (1979)
Kanizsa, G.: Seeing and thinking. Acta Physiol. 59(1), 23–33 (1985)
Kopf, J.: Depixelizing pixel art. SIGGRAPH 30, 99:1-99:8 (2011)
Kopf, J., Lischinski, D.: Depixelizing pixel art. In ACM SIGGRAPH. 1–8 (2011b)
Lai, Y.-K., Shi-Min, H., Martin, R.R.: Automatic and topology-preserving gradient mesh generation for image vectorization. ACM TOG 28(3), 1–8 (2009)
Leclerc, Y.G., Zucker, S.W.: The local structure of image discontinuities in one dimension. IEEE PAMI 3(1987), 341–355 (1987)
Lecot, G., Levy, B.: ARDECO: Automatic region detection and conversion. In EGSR. 349–360 (2006)
Lindeberg, T.: Junction detection with automatic selection of detection scales and localization scales. In: Proceedings of 1st international conference on image processing, 1. IEEE, 924–928 (1994)
Liu, C., Wu, J., Kohli, P., Furukawa, Y.: Raster-to-vector: Revisiting floorplan transformation. In ICIP. 2195–2203 (2017)
Mantegazza, C., Novaga, M., Pluda, A.: Motion by curvature of networks with two triple junctions. Geom. Flows 2(1), 18–48 (2016)
Merriman, B., Bence, J.K., Osher, S.J.: Motion of multiple junctions: a level set approach. J. Comput. Phys. 112(2), 334–363 (1994)
Moisan, L.: Affine plane curve evolution: a fully consistent scheme. IEEE Trans. Image Process. 7(3), 411–420 (1998)
Montero, A.S., Lang, J.: Skeleton pruning by contour approximation and the integer medial axis transform. Comput. Graph. 36(5), 477–487 (2012)
Nitzberg, M., Mumford, D. B.: (1990). The 2.1-D sketch. IEEE Computer Society Press
Nitzberg, M., Mumford, D., Shiota, T., Mumford, D.: Filtering, segmentation and depth. Lecture Notes in Computer Science 662 (1993)
Noble, J.A.: Finding half boundaries and junctions in images. Image Vis. Comput. 10(4), 219–232 (1992)
Olsen, S., Gooch, B.: x Image simplification and vectorization. In ACM SIGGRAPH. 65–74 (2008)
Orchard, M.T., Bouman, C.A., et al.: Color quantization of images. IEEE Trans. Signal Process. 39(12), 2677–2690 (1991)
Orzan, A., Bousseau, A., Winnemöller, H., Barla, P., Thollot, J., Salesin, D.: Diffusion curves: a vector representation for smooth-shaded images. ACM TOG 27(3), 1–8 (2008)
Owen, C. B., Makedon, F.: High quality alias free image rotation. In: Conference record of the thirtieth asilomar conference on signals, systems and computers. Vol. 1. IEEE, 115–119 (1996)
Park, W., Leibon, G., Rockmore, D.N., Chirikjian, G.S.: Accurate image rotation using Hermite expansions. IEEE Trans. Image Process. 18(9), 1988–2003 (2009)
Price, B., Barrett, W.: Object-based vectorization for interactive image editing. Vis. Comput. 22(9), 661–670 (2006)
Quint, A.: Scalable vector graphics. IEEE Multimedia 10(3), 99–102 (2003)
Sapiro, G., Tannenbaum, A.: Affine invariant scale-space. Int. J. Comput. Vis. 11(1), 25–44 (1993)
Selinger, P.: Potrace: a polygon-based tracing algorithm. Potrace (online), http://potrace.sourceforge.net/potrace.pdf (2009-07-01) 2 (2003)
Sloan, K.R., Tanimoto, S.L.: Progressive refinement of raster images. IEEE Trans. Comput. 28(11), 871–874 (1979)
Sun, J., Liang, L., Wen, F., Shum, H.-Y.: Image vectorization using optimized gradient meshes. ACM TOG 26, 11-es (2007)
Swaminarayan, S., Prasad, L.: Rapid automated polygonal image decomposition. In AIPR. IEEE, 28–28 (2006)
Taylor, J.E.: Motion of curves by crystalline curvature, including triple junctions and boundary points. Proc. Symp. Pure Math. 54, 417–438 (1993)
Tombre K., Tabbone, S.: Vectorization in graphics recognition: to thin or not to thin. In ICPR. 2, 91–96 (2000)
Vector Magic. https://vectormagic.com
Weiman, C.F.R.: Continuous anti-aliased rotation and zoom of raster images. In: Proceedings of the 7th annual conference on Computer graphics and interactive techniques. 286–293 (1980)
Xia, T., Liao, B., Yizhou, Yu.: Patch-based image vectorization with automatic curvilinear feature alignment. ACM TOG 28(5), 1–10 (2009)
Xumin, L., Xue, Y.: Research on vectorization of weather radar image. Proc. Eng. 15(2011), 1298–1302 (2011)
Yang, H.-M., Lu, J.-J., Lee, H.-J.: A Bezier curve-based approach to shape description for Chinese calligraphy characters. In ICDAR. IEEE, 276–280 (2001)
Zhao, H.-K., Chan, T., Merriman, B., Osher, S.: A variational level set approach to multiphase motion. J. Comput. Phys. 127(1), 179–195 (1996)
Author information
Authors and Affiliations
Contributions
All authors jointly wrote the main manuscript text. Yuchen He implemented the algorithm, produced the experiments, and prepared the figures. All authors reviewed the manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that there is no conflict of interest.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
An online demo of the method is available here: https://ipolcore.ipol.im/demo/clientApp/demo.html?id=5555531082036.
Appendix A Intersection Test for Two Line Segments
Appendix A Intersection Test for Two Line Segments
This technique is classical in computational geometry, and we state the details for completeness and reproducibility. Suppose we have two line segments \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\), the task is to determine whether they intersect, and if they do, whether they intersect at the segment’s interior or boundary, i.e., the end points. The key quantities for such decisions are
These signs indicate relative positions of the involved points. For example, \(q_0\) indicates by \(-1\), \(+1\), and 0, respectively, whether \(Q_0\) lies one the right-hand side of, or left-hand side of, or on the line passing through \(P_1\) and \(P_0\). We have the following cases:
-
1.
\(q_0q_1<0\) and \(p_0p_1<0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(T^*\) that lies in the interior of both lines.
-
2.
\(q_0q_1<0\), \(p_0=0\), and \(p_1\ne 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(P_0\), which is in the interior of \(\overline{Q_0Q_1}\).
-
3.
\(q_0q_1<0\), \(p_0\ne 0\), and \(p_1= 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(P_1\), which is in the interior of \(\overline{Q_0Q_1}\).
-
4.
\(p_0p_1<0\), \(q_0\ne 0\), \(q_1= 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(Q_1\), which is in the interior of \(\overline{P_0P_1}\).
-
5.
\(p_0p_1 <0\), \(q_0= 0\), \(q_1\ne 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(Q_0\), which is in the interior of \(\overline{P_0P_1}\).
-
6.
\(p_0=0\), \(p_1\ne 0\) \(q_0= 0\), \(q_1\ne 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(P_0=Q_0\).
-
7.
\(p_0\ne 0\), \(p_1= 0\) \(q_0= 0\), \(q_1\ne 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(P_1=Q_0\).
-
8.
\(p_0=0\), \(p_1\ne 0\) \(q_0\ne 0\), \(q_1= 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(P_0=Q_1\).
-
9.
\(p_0\ne 0\), \(p_1= 0\) \(q_0\ne 0\), \(q_1= 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) intersect at \(P_1=Q_1\).
-
10.
\(p_0=0\), \(p_1= 0\) \(q_0= 0\), \(q_1= 0\). \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) have infinitely many intersection points. This is practically impossible due to numerical perturbation.
-
11.
Otherwise, \(\overline{P_0P_1}\) and \(\overline{Q_0Q_1}\) do not intersect.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
He, Y., Kang, S.H. & Morel, JM. Topology- and Perception-Aware Image Vectorization. J Math Imaging Vis 65, 874–893 (2023). https://doi.org/10.1007/s10851-023-01149-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10851-023-01149-8