Skip to content
CornerTools

PNG to SVG

Trace a logo, icon, signature or line drawing from PNG or JPG into a scalable SVG, with presets and a compare slider.

Drop an image here or paste it, or

Your images never leave your device

Traced in this browser · JPG, PNG, WebP, GIF, BMP, AVIF, HEIC or TIFF · one at a time

Image type

2 to 64; fewer give a simpler, smaller SVG.

Removes the colour around the edges. Clear areas of the image stay clear either way.

Turns a PNG, JPG or other picture into an SVG: shapes of flat colour that stay sharp at any size, for a logo that must print large, a signature to place in a document, or an icon to edit in a vector program. Choose what the image is, compare the SVG with the original under the slider, zoomed up to 4×, and download the file or copy its code. It works best on logos, icons, line art and signatures, which are made of a few flat colours. A photo becomes a poster of flat colour areas, never a copy of the photo. The image is traced in your browser and never uploaded.

How to use it

Image type sets the colours and detail for the kind of picture, as the table below lists. Each image you open starts as Logo or icon, or as Photo (posterised) when it has the many shades of a photo. Once you choose a type yourself, it stays for every image you open until you close the page or reset the options. Colours (2 to 64) starts at the preset's count: fewer colours give a simpler, smaller SVG, and merge the in-between shades that smooth edges leave. If the image has fewer colours than asked, only those found are drawn, and the count under the result says how many.

Transparent background removes the colour that covers most of the image's border, when it covers at least 60% of it, so a white or slightly noisy background goes. Where no colour does (a photo to its edges), nothing is removed and the result says so. Areas that are clear in the image itself stay clear either way.

Under the result are its file size, paths and colours. A result of more than 20,000 paths or 2 MB is flagged: such a file is slow to open and edit. A trace still running after 60 seconds is stopped; Stop ends one sooner. Options are remembered on this device.

How the image is traced

The image is first resized so its long side falls within the preset's trace size. A small logo is enlarged smoothly, so the outlines follow its edges rather than its pixel steps; a large photo is reduced. The SVG keeps the original's size in pixels as its width, height and viewBox either way.

Its pixels are then grouped into the chosen number of colours. The starting colours are the most common ones that differ most from each other, so a small accent colour in a logo keeps its own group instead of being averaged into its neighbours; the groups are then refined by k-means. With two colours, the image is split at Otsu's threshold on lightness instead, which separates ink from paper even under uneven light.

Each colour is a layer. Its areas are outlined, outlines too short to matter are dropped as specks, and each outline is fitted with straight lines and quadratic curves that stay within the preset's tolerance, by the open-source imagetracerjs. The largest areas are drawn first, and each area is edged in its own colour, so no hairline gaps show between neighbours. Coordinates are written to one decimal place.

The presets

What each Image type sets
Image typeColoursBackgroundToleranceTrace size (long side)
Logo or icon8Kept1 px, sharp corners800–1,600 px
Line art or signature2Removed2 px1,600 px
Illustration24Kept0.5 px, sharp corners800–1,600 px
Photo (posterised)16Kept1 px, smoothed first800–1,600 px

Frequently asked questions

An SVG from tracing is made of areas of flat colour, and a photo has thousands of shades. Photo (posterised) smooths it and keeps 16 colours, which reads as a poster; more colours come closer but give a far larger file. For a photo, a PNG or JPG is the better format.
JPG compression leaves faint blotches around edges, and each is traced as a shape if it gets a colour of its own. Lower Colours to merge them into their neighbours, or use Logo or icon rather than Illustration, which keeps smaller shapes. A PNG of the logo traces more cleanly than a JPG.
Photograph or scan it on plain paper and choose Line art or signature: the ink is separated from the paper and the paper removed, leaving the ink on a clear background. Signature Maker makes a clean transparent PNG first, if the photo is dim or creased.
Yes. It opens in any vector editor, such as Inkscape, Illustrator or Figma, with each colour as a group of shapes, so a colour can be changed in one place. It is also plain text, which Copy SVG code puts on the clipboard for a web page.

See also