PNG to SVG with Unlimited-SVG: AI Raster-to-Vector Guide

Converting a PNG, JPEG, or WebP graphic into a genuinely editable SVG file has long been a headache for designers and frontend engineers. This guide explains how Baidu's open-source Unlimited-SVG model redraws raster graphics into clean SVG primitives, how to prepare your input images for maximum fidelity, and where to test conversion right now.

Why Traditional PNG to SVG Converters Produce Messy Code

When you upload a PNG logo, icon, or presentation graphic to a classic online vectorizer, the underlying algorithm usually runs color quantization followed by boundary tracing (such as Potrace or VTracer). That approach works acceptably on simple two-tone silhouettes, but breaks down quickly on real-world production assets:

  • Anti-aliasing artifacts: Soft pixel edges around curves generate dozens of tiny sliver paths instead of a single smooth Bezier curve.
  • Broken typography: Small text labels get traced as irregular blobs rather than crisp, legible geometry.
  • Huge, uneditable markup: A simple chart can balloon into hundreds of kilobytes of unnamed <path> fragments that are painful to edit in Figma or React components.

How Unlimited-SVG Solves PNG-to-SVG Synthesis

Rather than tracing pixel boundaries, Baidu's Unlimited-SVG treats vectorization as a multimodal vision-to-code task. Its visual frontend (DeepEncoder) takes an entire 2048 × 2048 image and compresses it into 1,024 high-density vision tokens. From there, a sparse Mixture-of-Experts (MoE) decoder activating ~0.5B parameters per token writes valid XML SVG code element by element.

Because the decoder is optimized for long-horizon output exceeding 10,000 SVG tokens, it can faithfully reconstruct multi-color brand marks, flat illustrations, badges, infographics, and dense diagrams without cutting off halfway through the file.

How to Prepare PNG Images for Best Results

  1. Pad cleanly to a square canvas: Unlimited-SVG's standard preprocessing pads non-square images onto a 2048 × 2048 square canvas rather than stretching aspect ratios. Avoid pre-stretching your PNG before uploading.
  2. Use crisp contrast on transparent PNGs: If your PNG logo has a transparent background, composite it onto a high-contrast solid background (white for dark marks, dark neutral for white marks) so thin strokes remain unmistakable.
  3. Avoid heavy JPEG compression noise: Start from lossless PNG whenever possible. Heavy JPEG ringing around small labels can introduce stray vector shapes.
  4. Tune sampling temperature by asset type: For geometric logos, icons, and diagrams, greedy or near-zero temperature (temperature = 0 to 0.2) enforces strict coordinate accuracy. For painterly or illustrative PNGs, a slightly higher temperature allows smoother stylistic curves.

Try It Now or Run Locally

While managed cloud conversion directly inside UnlimitSVG.com is being built, you have two immediate ways to convert your PNG files with the real model:

Related Guides