PNG to DXF converter

Trace a PNG or JPG into closed DXF outlines at the size you choose.

Drop a PNG or JPG hereor click to choose one from your computerDark shapes on a light background trace best. The image is read in this browser and never uploaded.
Traced outline Inside a shapeThe DXF holds the outlines only.

Lower detail smooths the outlines and drops specks. Higher detail keeps small features.

Units in the DXF

Open a PNG or JPG, or try the sample, to see the outlines.

How to convert a PNG or JPG to DXF

  1. Drop a PNG or JPG on the box above, or click Open an image. WebP, BMP and GIF images work too. The image is read in this browser tab and never uploaded.
  2. Check the preview. Each traced outline is drawn in black, and the inside of each shape is shaded.
  3. Move Threshold until the outlines follow the edges. Move Detail down until specks drop out, and up if small features disappear.
  4. Type the Width or the Height of the image in millimetres or inches. The other side follows the proportions of the image.
  5. Click Download DXF.

To try the steps first, click Try a sample: a gear on an image 100 mm square.

How the tracing works

The converter reads the image as grey levels and splits them at the threshold, so pixels darker than the threshold are inside a shape. The automatic threshold starts from Otsu's method, which picks the grey level that best separates the dark pixels from the light ones. The converter then moves the threshold to the midpoint between the average grey levels of the two groups, which puts an anti-aliased edge where a pixel is half covered.

The outlines come from marching squares, which finds where the grey level crosses the threshold between neighbouring pixels by linear interpolation. An edge therefore lands between pixels instead of following the staircase of pixel corners. The converter then drops specks smaller than the Detail setting allows, and removes points that sit within a fraction of a pixel of a straight line, with the Ramer-Douglas-Peucker algorithm.

On the sample gear, drawn at 10 pixels per millimetre, the traced outline stays within 0.06 mm of the exact gear, and the 12 mm holes trace to within 0.04 mm of their diameter. A JPG copy of the same gear, saved at quality 60, traces to the same figures.

Getting a clean trace

What a traced DXF cannot give you

Tracing finds the edges of shapes in a picture. The tracer cannot know what the shapes are meant to be.

For a part cut to a tolerance, use the traced DXF as a reference and redraw the critical features in CAD. When the shape exists as vector art, the SVG to DXF and PDF to DXF converters keep the exact geometry.

Quote the parts in the sketches and scans customers send

Tell Derik how requests for quote reach your estimators and what they price from. He will tell you what a four-week build would cover.

Start a conversation

From a traced outline to a quote

A request for quote can arrive as a photo or a scan instead of a CAD file. Once the outline is a DXF, the DXF viewer measures the cut length, the pierces and the weight, which are the inputs to a cutting price. The Fabricator's guide to estimating gives cutting time as the cut length over the cutting speed, plus the pierces times the pierce time.

ThriveAI builds quoting systems that read each request with the drawings attached, measure the parts and draft the quote from the shop's own rates, for an estimator to approve. See AI quoting software for how the build works.

Questions

How do I convert a JPG to DXF?
Open the JPG on this page, and the converter traces it into closed outlines. Adjust the threshold and the detail until the outlines follow the shapes, set the width, and click Download DXF. A JPG traces the same way as a PNG, though JPEG compression can leave edges a little ragged.
Can I convert a photo to DXF?
Only a photo with strong contrast, such as a dark part on a white sheet, shot square to the camera. Shading and texture in an ordinary photo trace into many small shapes. Lens distortion and perspective also change the proportions, so check every dimension before you cut.
Why does a line in my drawing come out as two lines?
The converter traces outlines. A drawn line has a width, so the line comes out as a thin closed shape with an edge on each side. For a single cutting path, redraw the line in CAD, or convert the original vector file with the SVG to DXF or PDF to DXF converter.
What threshold should I use?
Start with the automatic threshold, which splits the grey levels into dark and light. Lower the threshold if thin dark lines break up, and raise it if dark specks join the shapes. The preview updates as you move the slider.
How do I set the size of the DXF?
Type the width or the height under Units in the DXF. The other side follows the proportions of the image. When the image records a resolution of 100 dpi or more, such as a 300 dpi scan, the converter starts at that true size. Otherwise the image starts 100 mm wide.
Is my image uploaded?
No. The image is decoded and traced in your browser, and nothing about it is sent to ThriveAI or anyone else. The page counts how often the tool is used, with the number of shapes and holes, the file type and the file size, and never records the image or the outlines.

Contact

Quote parts from sketches and photos faster

Tell Derik how requests for quote reach your estimators and which files they price from. He will tell you what a four-week build would cover.

Prefer to talk? Book a meeting.

Your message goes to Derik Lawlis, the founder.