Convert Vector Drawable to SVG

12,579

Solution 1

Have a look at this Convert VectorDrawable to SVG

The Vector Drawable format is pretty similar to SVG. With just a few modifications you can turn your xml drawable back to SVG

Credits to this guy who made this python script that coverts xml drawables back to SVG https://gitlab.com/Hyperion777/VectorDrawable2Svg

Solution 2

Look at this Shapeshifter

Shapeshifter tool can import VectorDrawable XML file and export back to SVG file

Share:
12,579
sadat
Author by

sadat

I am a passionate mobile application developer and always look for solving problems.

Updated on June 28, 2022

Comments

  • sadat
    sadat almost 2 years

    Is there any tool to convert Vector Drawable to SVG? I lost my original svg file and now I would like to reduce the size of the image. Currently, I have,

    <vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="1200dp"
        android:height="1200dp"
        android:viewportHeight="1200"
        android:viewportWidth="1200">
    

    I would like to make it 180x180. Thanks in advance.

    • pskink
      pskink over 6 years
      do you want to remove some points on your path? change them somehow? or just "scale down"?
    • sadat
      sadat over 6 years
      I just wanna scale it down.
    • pskink
      pskink over 6 years
      so this is pointless - it does not matter how big your android:viewportWidth / android:viewportHeight are, as the vector drawable is scalable and can be drawn with any size on the target canvas
    • Xenolion
      Xenolion over 6 years
      Cant you just edit and width to 800dp to reduce its size?
    • sadat
      sadat over 6 years
      Thanks. I know that. But I am having inflationexception due to using such a big image. There are quite a few posts in stackoverflow.
    • pskink
      pskink over 6 years
      what exception? post the stacktrace
    • sadat
      sadat over 6 years
      InflateException @pskink
    • pskink
      pskink over 6 years
      post the stacktrace
    • Faris Kapo
      Faris Kapo over 6 years
      Does the solution have to be trough code ?
  • NoHarmDan
    NoHarmDan about 3 years
    By far the fastest and easiest solution
  • pallgeuer
    pallgeuer almost 3 years
    For me it didn't support gradients (<gradient> tag in vector drawable), so I couldn't use it in my case