forgehub. A small, independent toolbox

PNG to SVG

How to trace and save a PNG shape with PNG to SVG

Choose a still PNG or Use example, adjust Threshold, Invert selection and Working raster while checking the binary mask, then choose Trace shape. Inspect the vector preview and trace ledger before downloading the SVG. PNG to SVG creates closed black paths with transparent holes; it does not preserve colors or reconstruct smooth curves. Settings changes clear the export, so trace again before saving.

Open PNG to SVG

Trace the square-ring example first

Choose Use example to load a 96 by 96 image containing a square ring and a small detached square. Leave Threshold at its initial value of 128 and Invert selection unchecked. The Original PNG and Binary mask previews appear immediately; the Vector SVG remains untraced until you choose Trace shape.

After tracing, inspect the ring opening and the detached mark in the vector preview. The example produces three closed contours and twelve vertices: an outer ring boundary, its inner boundary and the separate square. A contour is a boundary, so three contours do not mean three separate solid objects. The hole should remain transparent.

Choose a suitable still PNG

Use Choose a PNG to replace the example with one local file. Start with a high-contrast icon, silhouette or line drawing whose useful information can survive as a black shape. This is a monochrome tracer: a photograph, gradient or multicolored logo will lose distinctions when reduced to selected and unselected pixels.

The input must be a still PNG no larger than 5 MiB, with at most 4,000,000 decoded pixels and neither dimension above 4096 pixels. These are separate requirements; a small compressed file can still exceed the pixel limit. Animated PNG is rejected. If replacement fails, read the error and choose a suitable file; the previous valid source is retained.

Use the mask to decide what becomes black

Threshold selects pixels darker than its value. Raising it includes more lighter pixels; lowering it excludes more of them. For example, an opaque neutral-gray pixel with red, green and blue values of 128 is excluded at threshold 128 because the comparison is strictly less than. At 129 it is included. Inspect the Binary mask as you adjust rather than expecting the original colors to appear in the SVG.

Alpha is flattened onto white before selection. A fully transparent pixel therefore behaves as white, while a partially transparent dark edge becomes lighter. Invert selection selects the complement of the mask, including areas that were previously unselected. Check the whole image after inversion: it can turn the surrounding background into the black shape.

Working raster offers maximum sides of 512, 256 and 128 pixels. Smaller settings reduce geometry and lose detail; small sources are never enlarged. A 1200 by 600 source uses a 512 by 256 working raster at the largest setting. This is the pixel grid being traced, even though the SVG retains the original outer dimensions and aspect ratio.

Inspect the trace and recover from limits

Choose Trace shape after settling the mask. Compare Vector SVG with Binary mask, especially narrow gaps, small detached marks and holes. The Trace ledger separates source dimensions from working dimensions and reports selected pixels, closed contours, vertices and SVG bytes. Use those figures to understand the generated geometry; they are not a smoothness score.

Edges follow pixel cells, with straight-line intermediate vertices removed. Curved artwork can therefore look angular. The app does not reconstruct smooth curves, colors, gradients or text. There is no built-in vector editor for repairing the result.

If no shape is selected, raise the threshold or invert and trace again. Tracing stops above 100,000 boundary segments, above 5 MiB of SVG output or after five seconds. Try a smaller working raster or simpler artwork for complexity and timeout errors. Cancel tracing stops an active job. If Web Workers are unavailable, local processing falls back to a maximum side of 256 pixels.

Download the current SVG before leaving

When the current trace is ready, choose Download SVG. If browser settings open files instead of saving them, use Open local SVG / save manually. The output contains black vector geometry on a transparent background, with holes preserved, rather than a PNG embedded inside an SVG.

Changing threshold, inversion or working raster clears the old vector and disables its export immediately. Trace again to create a result for the new settings. Save a useful version before trying another valid source or the example. Files and results stay in tab memory without uploads or saved history; Reset, reload or leaving the page discards the work.

AI-assisted ForgeHub editorial. App capabilities were checked against its implementation; this guide is not an independent review.

Frequently asked questions

Can I keep the original PNG colors?

No. The app selects a binary silhouette and exports black paths on a transparent background. Colors and gradients are not reconstructed; choose artwork that remains useful in monochrome.

Why is Download SVG disabled after I move the threshold?

Every settings edit invalidates the old export. Inspect the updated mask and choose Trace shape again; downloading becomes available after a successful current trace.

Does a 512 px working raster enlarge my small PNG?

No. The working raster is capped at the selected maximum side and is never enlarged. The SVG uses the original dimensions, but its path detail comes from the working raster.

Will a rejected replacement erase my existing trace?

An invalid replacement preserves the previous valid source and export. Correct the reported file problem and try again. A successfully accepted replacement clears the old result and needs its own trace.