Open FlatCad

JPG to SVG converter

Convert a JPG of a drawing, signature, stamp or logo into an SVG of smooth outlines at a real size in millimetres. This page is about the photos and scans JPG files usually are: how to light them, which inks trace, and how to get rid of the noise JPEG compression leaves behind.

Trace an image

The picture being traced

How to convert a JPG to SVG

  1. Drop the JPG above. The traced outlines appear over the picture straight away.

  2. Check the threshold. Automatic threshold picks the grey level that best splits the picture into two groups, ink and paper. Untick it to set your own.

  3. Clean it up with Ignore specks, then Smoothness.

  4. Type the width in millimetres and download the SVG or DXF, or open it in FlatCad with the picture still underneath to fix things by hand.

Which inks and papers trace

The tracer turns each pixel into a brightness from 0 (black) to 255 (white), weighting green most and blue least, the way the eye does. Ink is what falls below the threshold, so what counts is how dark a colour is, not what colour it is:

On white paperBrightnessResult
Black marker or printed black0 to 40Traces perfectly
Pure blue inkabout 29Traces (blue looks bright but reads dark)
Pure red inkabout 76Traces
Pencil100 to 180, unevenNeeds the threshold set by hand, and often breaks up
Light blue ruled linesabout 190Usually ignored, which is handy for notebook sketches
Yellow highlighterabout 225Disappears

Real inks are less pure than these values, and a phone photo dims everything a little, so treat the table as a guide to which way to move the slider. Cream or grey paper narrows the gap between ink and paper: pencil on cream paper is the hardest common case.

Taking a photo that traces

JPEG noise and the speck filter

JPEG compression stores the picture in 8 × 8 pixel blocks and blurs sharp edges into a fringe of grey blotches, especially in files saved at low quality or forwarded through a messaging app. Paper texture adds its own dots. All of it traces as tiny shapes or tiny holes in your lines.

Ignore specks drops every dot and hole smaller than the area shown, in pixels of the traced image. The slider works on a log scale, so small moves at the left are fine steps and at the right are big ones. For a landscape photo traced at the default Detail of 1200 pixels across and set to 100 mm wide, one pixel is 0.083 mm:

Make the design bigger and the same setting removes bigger dots in millimetres, because a pixel covers more paper.

Detail, smoothness and corners

Detail is the size the picture is traced at, as its longest side in pixels, from 400 to 2400. A 4000-pixel phone photo is scaled down to it. A picture smaller than half the Detail is scaled up to half of it, at most four times, so its pixel steps become curves; anything in between is traced as it is. More detail keeps thin strokes but follows more noise; 1600 suits signatures, 800 is enough for a bold logo.

Smoothness is how far, in pixels, a fitted curve may stray from the traced edge. Low keeps every wobble of a hand-drawn line; high gives fewer, rounder curves and smaller files. Sharp corners sets which bends stay pointed: a bend whose angle is at or below the setting stays a corner, and gentler ones are rounded off. The angle is measured over several pixels either side, so the stair-steps along a slanted straight edge read as about 155° or more and stay smooth unless the slider is near its top.

Messages

Going on to cut the outlines on a router or laser? Image to DXF covers what the machine needs from the trace. A logo with a transparent background traces differently; see PNG to SVG.

Open FlatCad, free, no signup

Questions

Can I convert a photo of a person or a view?

Not usefully. Tracing follows the edge between dark and light, and a face or landscape has thousands of soft edges, so the result is a mess of blobs. Engrave those photos as a picture, or reduce them to a two-tone image in a photo editor first and trace that.

Why is one side of my drawing missing?

The threshold is one value for the whole picture, so a photo lit from one side has paper on the dark side that is darker than the ink on the bright side. Retake it in even daylight, or scan it, rather than fighting the threshold slider.

How do I make a signature into an SVG?

Sign with a black felt pen, not a ballpoint, on white paper and photograph it flat in daylight or scan it. Set Detail to 1600 or more, Smoothness to about 0.6 and Ignore specks low so the thin ends of strokes stay. Set the width to the size you'll use it at.

My pen lines came out broken. What helps?

Move the threshold to the right so paler parts of the line count as ink, then raise Ignore specks to clean up the paper texture this lets in. If the lines are blue ballpoint, retrace them in black marker; blue ink is often too close to the paper's brightness.

Is the JPG uploaded?

No. It is traced in your browser and never leaves your computer.