What happens when you convert a PNG to SVG

Converting a PNG to SVG is possible, but the result depends entirely on what kind of image you started with. A PNG is made of pixels — tiny colored squares arranged in a grid. An SVG is made of mathematical instructions that tell a computer to draw shapes, lines, and curves. When you convert, the software has to guess where those shapes are and describe them mathematically.

This works well for images with solid colors and clean edges: logos, straightforward illustrations, line drawings, text. It works poorly for photographs, gradients, and anything with lots of detail or soft transitions. The converted file will either be huge (because the software created thousands of tiny shapes to approximate the original) or blurry (because it simplified too much). You cannot recover detail that was never in the PNG to begin with.

Key Takeaways

  • PNG-to-SVG conversion works best on images with solid colors and clean edges, like logos and straightforward illustrations, and fails on photographs and detailed images.
  • Free tools like Potrace, Vectorizer.io, and Inkscape can convert a PNG, but each produces different results depending on how you adjust the settings.
  • The converted SVG file may be larger than the original PNG if the image has many colors or details, defeating the purpose of using SVG.
  • If you need an SVG version of a logo or design, redrawing it in a vector tool from scratch usually produces a better result than converting.
  • Some online converters store your images on their servers; if privacy matters to you, use desktop software like Inkscape instead.

When conversion makes sense and when it does not

Conversion is worth trying if you have a straightforward logo, icon, or line drawing with a white or transparent background and only a few colors. The result will be clean and the file size will shrink. Conversion is not worth your time if you have a photograph, a screenshot with text and windows, a watercolor painting, or anything with gradients and soft shadows. The converted file will be bloated or unrecognizable.

A practical test: if you can describe the image in a few sentences using only shape names (circle, rectangle, line) and color names, conversion will probably work. If you need words like "gradient," "shadow," "texture," or "detail," it will not.

Using Potrace for command-line conversion

Potrace is free, open-source software that runs on Windows, Mac, and Linux. It is the engine behind many online converters, but using it directly gives you more control and keeps your image on your own computer. read it from potrace.sourceforge.net, then open a terminal or command prompt and point it at your PNG file.

The basic command is straightforward: potrace yourimage.png -s -o output.svg. The -s flag tells it to output SVG. You can adjust how much detail it preserves with the -t flag (threshold), which ranges from 0 to 255. Lower numbers keep more detail; higher numbers simplify more. Start with -t 100 and adjust up or down depending on the result. If the output is too jagged, increase the threshold. If it is too blurry, decrease it.

Potrace works best on black-and-white or two-color images. For color images, it converts each color separately, which can produce unexpected results. If your PNG has many colors, you may need to reduce the color palette first using an image editor like GIMP (free) or Photoshop.

Using Inkscape to convert and edit in one step

Inkscape is a free vector drawing program available for Windows, Mac, and Linux. It has a built-in "Trace Bitmap" feature that converts PNG to SVG and lets you tweak the result before saving. Open your PNG in Inkscape, select it, then go to Path > Trace Bitmap. A dialog box will appear with several options.

The "Color Quantization" mode works for color images; "Brightness Threshold" works for black-and-white. Adjust the threshold slider to control how much detail is preserved — move it left to keep more, right to simplify. Click "Trace" and Inkscape will create an SVG version on top of your original PNG. You can then delete the PNG layer and edit the SVG directly: delete stray shapes, adjust colors, smooth rough edges, or add text.

Inkscape is slower than Potrace for batch conversions, but it is worth using if you plan to edit the result anyway. The learning curve is steep if you have never used a vector editor, but for straightforward cleanup it is manageable.

Online converters and what to know about them

Websites like Vectorizer.io, Online-Convert.com, and CloudConvert will convert your PNG to SVG without installing software. You upload the file, adjust a few settings, and read the result. They are convenient, but they store your image on their servers while processing it, which matters if the image contains sensitive information or if you are concerned about privacy.

Most of these sites are free for small files. Some offer batch conversion (multiple files at once) or higher resolution limits if you pay. The conversion quality varies — some use Potrace under the hood, others use different algorithms. If you try one and dislike the result, try another. Vectorizer.io and Online-Convert tend to produce cleaner results than generic converters, but test with a non-critical image first.

Why the converted file might be larger than the original

An SVG file is text-based, so it can be very small if the image is straightforward. But if your PNG has many colors or fine details, the conversion software has to create hundreds or thousands of tiny shapes to approximate the original. Each shape is a line of text in the SVG file. The result can be larger than the PNG, sometimes much larger.

You can compress an SVG by running it through SVGO (a command-line tool) or an online SVGO tool, which removes unnecessary data and shortens numbers. But if the file is already bloated from conversion, compression will only help so much. If file size matters — for a website, for example — and the converted file is larger than the original PNG, stick with the PNG.

Redrawing in a vector tool instead of converting

If you need a high-quality SVG of a logo or design and you have time, redrawing it from scratch in Inkscape or Adobe Illustrator produces a much better result than converting. The file will be smaller, cleaner, and easier to edit later. You can use the PNG as a reference layer, trace over it by hand, and build the shapes yourself.

This takes longer, but it is the standard workflow for professional designers. If the image is straightforward — a few shapes and colors — it may take only 15 to 30 minutes. If you are converting a complex illustration, redrawing is probably not practical. But for logos, icons, and straightforward graphics, it is worth considering.

Frequently Asked Questions

Can I convert a JPEG to SVG the same way?

Yes, the same tools work on JPEG files. But JPEG is a lossy format designed for photographs, so the image already has compression artifacts. Converting a JPEG to SVG will amplify those artifacts and produce a messier result than converting a PNG. If you have a choice, convert from PNG or a lossless format.

What if the converted SVG has a white background I do not want?

Open the SVG in a text editor (Notepad, VS Code, or any plain-text editor) and look for a <rect> element near the top with a white fill. Delete that line. If you used Inkscape, you can also delete the background layer before saving. Online converters usually have a checkbox to remove the background before conversion.

Will the SVG look the same size as the PNG?

Not necessarily. SVG files do not have a fixed pixel size — they scale to fit their container. When you open an SVG in a browser or editor, it may appear larger or smaller than the original PNG depending on the viewBox settings. You can edit the width and height in the SVG code, or right-click and choose "Properties" in most editors to resize it.

Is it safe to upload my image to an online converter?

Most reputable converters delete uploaded files after processing, but you cannot be certain. If the image contains confidential information, a logo you have not published, or anything you want to keep private, use desktop software like Potrace or Inkscape instead. They process everything on your own computer.

Can I convert a PNG with transparency to SVG and keep the transparency?

Yes. Potrace, Inkscape, and most online converters preserve transparency. The converted SVG will have a transparent background if the PNG did. When you open the SVG in a browser or editor with a white background, it will appear to have a white background, but the transparency is still there — it just shows the background behind it.