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
How to convert a JPG to SVG
Drop the JPG above. The traced outlines appear over the picture straight away.
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.
Clean it up with Ignore specks, then Smoothness.
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 paper | Brightness | Result |
|---|---|---|
| Black marker or printed black | 0 to 40 | Traces perfectly |
| Pure blue ink | about 29 | Traces (blue looks bright but reads dark) |
| Pure red ink | about 76 | Traces |
| Pencil | 100 to 180, uneven | Needs the threshold set by hand, and often breaks up |
| Light blue ruled lines | about 190 | Usually ignored, which is handy for notebook sketches |
| Yellow highlighter | about 225 | Disappears |
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
- Light it evenly. One threshold is used for the whole picture. Daylight from a window across the page, or a scanner, beats a desk lamp, whose bright spot and dark corners push parts of the paper past the threshold.
- Shoot straight down and fill the frame. A tilted phone makes the drawing a trapezoid, and the size you type is then only right along one edge.
- Crop to the design. The table edge, your phone's shadow or a thumb becomes an outline too.
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:
- the default 12 px² removes dots up to about 0.33 mm across;
- 99 px² (slider at 2) removes dots up to about 0.94 mm: right for a noisy phone photo;
- 999 px² (slider at 3, the maximum) removes anything up to about 3 mm, which also takes out full stops and the dots on i and j.
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
- "Everything counts as the shape": the picture is mostly darker than the threshold, usually a dark background. Tick Light shapes on a dark background for chalk on a blackboard or white on black, or move the threshold left.
- "Nothing found at this threshold: move it right.": the ink is fainter than the threshold.
- "That image is too big" appears over 40 MB, which only very large scans reach; save them as JPG at a lower size.
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.
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.