This post was drafted with AI assistance and reviewed by the PerfectVector team.

Android Studio won't trace a PNG. Vector Asset Studio imports a Local file (SVG, PSD) and turns supported geometry into VectorDrawable XML (Android Developers). So a PNG icon takes two conversions: trace the pixels into a real SVG, then import that SVG. Each step can quietly change your icon, and the SVG in the middle is the cheapest place to catch it. Before importing, confirm the file is actually paths: an SVG can wrap a bitmap in an <image> element, and that won't become a vector drawable.

The mapping from SVG to VectorDrawable is close but not one-to-one. Here's a 24 dp ring icon, written both ways:

<!-- ring.svg --> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> <path fill="#1D9B5F" fill-rule="evenodd" d="M12 2a10 10 0 1 0 0 20a10 10 0 1 0 0-20zM12 7a5 5 0 1 0 0 10a5 5 0 1 0 0-10z"/> </svg> <!-- res/drawable/ic_ring.xml --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="#1D9B5F" android:fillType="evenOdd" android:pathData="M12 2a10 10 0 1 0 0 20a10 10 0 1 0 0-20zM12 7a5 5 0 1 0 0 10a5 5 0 1 0 0-10z"/> </vector> 

viewBox becomes viewportWidth/viewportHeight (the coordinate space the paths live in), while width/height in dp is only the default display size. Change the viewport and you re-map the geometry; change the size and you just scale it. d becomes pathData with the same command syntax. The trap is the hole. Both circles in that path run in the same direction, so the hole only exists because of the even-odd fill rule. Render it with the default nonZero rule and you get a solid green disc. The VectorDrawable reference lists android:fillType as SDK 24+ with nonZero as the default, and the same API level for gradient fills. Tracers love even-odd holes, so test icons with counters on your minimum API level, not only in the Studio preview.

The importer also supports only a subset of SVG. Per the same Android page: one clipping mask per group, only centered strokes, no blend modes, no dashed paths, no filter effects (drop shadows, blurs), no text (convert it to shapes) and no pattern fills. An icon can look perfect in a browser and still lose a shadow, a mask or a label on import. Flatten those in the SVG master, keep that master, and regenerate the drawable from it rather than hand-editing two versions.

Finally, know when to stop. Android recommends limiting a vector image to 200 x 200 dp, notes that the first load of a vector drawable can cost more CPU than the equivalent raster, and says detailed art such as many launch icons works better as raster. Simple icons are the sweet spot. Photos, texture and soft shadows should stay PNG.

The full guide covers choosing between a direct converter and the SVG route, an XML review checklist for groups and clipping, and on-device acceptance tests: PNG to Android Vector Drawable: An Import Checklist

We build PerfectVector, an image-to-vector tool.