How This PNG to XML Converter Works
An SVG file is a vector image written in XML. A PNG is a grid of pixels. Going from the grid to the XML means finding the outlines of the shapes in the picture and writing them as paths, which is called tracing or vectorizing. That is what this png to xml converter does, in your browser tab.
- The image is scaled to the detail size you chose and its pixels are read.
- In colour mode the tool finds the main colours with a median-cut palette and gives every pixel to its nearest colour. In black and white mode pixels darker than the threshold become ink.
- For each colour it follows the edges between pixels to get closed outlines, and drops outlines smaller than your speck setting.
- The outlines are simplified so a straight edge becomes one segment instead of hundreds of steps, then written as SVG paths with smooth curves where the edge is curved and sharp corners where it is not.
- Colours are stacked from the largest to the smallest, so no gaps show between neighbouring shapes.
What Traces Well and What Does Not
- Works well: logos, icons, badges, simple illustrations, flat colour graphics, stamps, signatures and black line art with clear edges.
- Works with care: scanned drawings and screenshots. Use black and white mode, raise the threshold until thin lines stay solid and use speck removal for scanner noise.
- Not suited: photographs. Tracing a photo with a few colours gives a poster-like picture, and with many colours gives a very large file. Keep photos as JPG or WebP.
The result can only be as good as the source. Start from the largest, cleanest version of the image you have. A tiny, blurry or heavily compressed JPG has edge noise that tracing will faithfully copy.
PNG to SVG, Android XML and Other Meanings of XML
People who search for png to xml, image to xml or convert picture to xml usually mean one of two things. The first is an SVG, because SVG is an XML format for graphics. That is what this tool produces. The second is the XML vector file used inside Android apps, called a vector drawable.
To get an Android file, trace the image here, download the SVG and paste it into SVG to XML, which writes an Android vector drawable. To go back the other way, XML to SVG turns an Android vector drawable into a normal SVG. A plain PNG cannot be turned into other kinds of XML data, because pixels hold no text or structure to extract.
Why Use a Vector Instead of a PNG
- Sharp at any size: the same file works as a favicon and as a banner or print.
- Small files for simple art: a flat logo is often a few kilobytes as SVG.
- Editable: change colours and shapes in Figma, Illustrator or Inkscape, or style them with CSS on a web page.
- Cutting and printing: sign makers, laser cutters and embroidery tools ask for vector paths.
To check the result as a pixel image, send it to SVG to PNG with the swap button. Both tools run entirely in your browser.