Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (50.2k points)
I just want to know that how can we convert a .png to .svg using only base R or CRAN functions?

1 Answer

0 votes
by (108k points)

I think for conversion, you can see the image_convert function from the magick package. Check the package description and the 'Converting formats' section from the package vignette.

library(magick)

my_image <- image_read("image.png")

my_svg <- image_convert(my_image, format="svg")

image_write(my_svg, "image.svg")

dir()

[1] "image.png"   "image.svg"

If you are a beginner and want to know more about R then do check out the following R programming tutorial

Related questions

Browse Categories

...