Image to DXF: convert a PNG into a DXF file
Image to DXF conversion is tracing: the pixels of a PNG are turned into vector paths, and those paths are saved as a DXF that laser cutters, CNC routers, and CAD programs can read. This viewer cannot vectorize images or write DXF files, so this page gives the free Inkscape method with the settings that matter, the centerline alternatives for technical drawings, and the checks that save a wasted sheet of material.
Which method for which case
| Image | Method | Tool |
|---|---|---|
| Logo, silhouette, lettering, stencil | Outline trace | Inkscape Trace Bitmap (free) |
| Line drawing, scanned plan, hand sketch | Centerline trace | Inkscape centerline mode (autotrace), WinTopo, Scan2CAD |
| Photo | Posterize first, then outline trace; expect simplification | GIMP or Photoshop, then Inkscape |
| Image for a SolidWorks or Fusion sketch | Trace to DXF, insert into sketch, redraw precise features | Inkscape, then the CAD program |
| Reference only in AutoCAD | No conversion; attach as underlay | IMAGEATTACH |
| Quick, non-confidential | Online PNG to DXF converter (Convertio and similar) | Uploads the image; no control over settings |
The DWG variant of the same task, including the manual-tracing route in AutoCAD, is on PNG to DWG.
Prepare the PNG: this decides the quality
Trace quality depends on the image more than on the tracer. Three preparations make the difference between a usable DXF and a mess. First, resolution: aim for the subject to be at least 1,000 pixels across; upscale a tiny icon in an image editor before tracing, because tracing a 200-pixel logo gives lumpy curves. Second, contrast: convert to grayscale and apply a threshold so every pixel is black or white, with no anti-aliasing gray. Third, cleanliness: remove the background, JPEG artifacts, and stray dots with a despeckle filter.
Transparent PNGs are fine; Inkscape treats transparent as white. Screenshots with thin one-pixel lines break up when thresholded; thicken lines with a dilate filter or draw them again at higher resolution.
How to convert PNG to DXF in Inkscape
- File > Import the PNG into a new Inkscape document, choose Embed. In Document Properties set the display unit to mm and resize the page to the drawing.
- Select the image, open Path > Trace Bitmap (Shift+Alt+B). Pick Single scan and "Brightness cutoff" with a threshold near 0.45; raise it if thin lines vanish, lower it if the background turns black. Tick "Remove background". In Options, set Speckles to about 10 pixels, Smooth corners around 1.0, and Optimize around 0.2.
- Click Update to preview, then Apply. Move the traced path aside and delete the original image.
- Inspect with the node tool (F2). A clean trace shows a modest number of nodes; thousands of nodes on a simple shape means the image needed more preparation. Path > Simplify (Ctrl+L) reduces them at the cost of accuracy.
- Scale the result to real size: select it, type the exact width in the toolbar W field with the lock on, in mm.
- If you need single cut lines rather than outlines, run the trace with the "Centerline tracing (autotrace)" mode in the same dialog, which produces open paths along the middle of each line.
- File > Save As, type "Desktop Cutting Plotter (AutoCAD DXF R14)", base unit mm, LWPOLYLINE output ticked.
Outline tracing makes every line a thin closed shape, which a laser would cut twice, once per edge. For engraving outlines that is correct; for cutting along a drawn line use centerline mode or redraw.
Centerline tools, SolidWorks, AutoCAD, and online converters
WinTopo (free edition) and Scan2CAD specialize in centerline vectorization of drawings: a scanned wall becomes one line, arcs are recognized as arcs rather than polylines, and Scan2CAD can OCR text into DXF text objects. Both write DXF directly, which skips Inkscape altogether. Potrace, the engine behind Inkscape's tracer, is also available as a command-line tool and outputs DXF with potrace -b dxf for batch jobs on Linux.
SolidWorks and Fusion 360 cannot open a PNG as geometry. Trace it to DXF first, then use Insert > DXF/DWG (SolidWorks) or Insert > Insert DXF (Fusion) into a sketch; expect many short segments, so for precise parts use the trace only as a guide and sketch the real dimensions over it. In AutoCAD, the equivalent is to open the DXF or to attach the PNG with IMAGEATTACH and trace by hand.
Online "png to dxf converter free" services run an automatic outline trace with fixed settings and upload your image. They are acceptable for a public logo and poor for anything with thin lines.
Image to DXF: what to check in the result
- Size. Measure the overall width; a 100 mm part that reads 378 was exported in px.
- Double lines. Zoom into a line: two parallel edges mean outline mode was used where centerline was wanted.
- Closed contours. Cutting software needs closed shapes; look for tiny gaps at sharp corners.
- Speckles. Small stray polylines from dust get cut as tiny holes; delete them.
- Segment count. Thousands of entities for a simple shape slow down the machine and show as faceted curves; simplify and re-export.
Open the DXF on dwgviewer.app to measure, count entities, and zoom in on corners without installing CAD; nothing leaves your computer. If the artwork is already a vector SVG, skip the trace entirely and follow SVG to DXF. For JPEG sources, which carry compression noise, see JPG to DXF.
Frequently asked questions
How do I convert a PNG to DXF?
Clean the image, import it into Inkscape, use Path > Trace Bitmap, scale the result to real size, and save as AutoCAD DXF R14 with polyline output.
Can you convert PNG to DXF for free?
Yes. Inkscape and the free edition of WinTopo both trace images and write DXF. Potrace does it from the command line.
How do I get a high quality PNG to DXF result?
Start from a large, high-contrast, black-and-white image; threshold and despeckle it; use centerline mode for drawings and outline mode for logos; keep the node count low.
How do I convert PNG to DXF for SolidWorks?
Trace the PNG to DXF in Inkscape, then Insert > DXF/DWG into a SolidWorks sketch. Use the trace as a guide and redraw critical dimensions.
Why does my DXF have two lines for every line in the image?
Outline tracing draws both edges of each stroke. Use centerline tracing (Inkscape autotrace mode, WinTopo, or Scan2CAD) for single lines.
Can AutoCAD convert PNG to DXF?
Not by itself. AutoCAD attaches images as underlays; automatic vectorization needs the Raster Design toolset or an external tracer like Inkscape.