Vai al contenuto
JustVectorizeAccedi
Vettorizza un'immagine

Convert an image to DXF for CAD, CNC, and laser cutting

How to turn a PNG or JPG into a clean DXF: which draw style to use, how to get real-world units and layers by color, and how to import the file into CAD, CAM, and laser software.

Per ora questo articolo è disponibile solo in inglese.

What a DXF needs to be useful

DXF (Drawing Exchange Format) is AutoCAD’s exchange format and the common language of CAD, CAM, and laser software. A PNG or JPG can’t be machined: a router, a plasma cutter, or a laser needs geometry — lines and arcs at known positions, in known units. Turning an image into a DXF means tracing it into that geometry first.

A DXF you can actually use has three things:

  • clean outlines — no specks, no doubled lines;
  • the right scale — a part drawn 120 mm wide opens 120 mm wide;
  • sensible organisation — layers you can map to operations.
What the machine needs: closed outlines built from lines and arcs, at a real size in real units.

Start from a clean, high-contrast image

  • High contrast wins. Black on white is ideal: logos, silhouettes, stencils, signs, line drawings. Photos make poor DXFs — see turning a photo into vector art for why.
  • Photographing a template or part? Shoot square to the camera, in even light; perspective distortion becomes geometry error. Scanning is better. Include something of known size so you can check the scale afterwards.
  • Use the largest copy you have, cropped tight to the design.

Trace it

  1. Upload the image; it’s traced straight away.
  2. In Settings → Palette → Choose palette, reduce the colors to the ones that matter. For a single profile — a part on a background — that’s two. Hide the background so it isn’t traced as a rectangle around everything.
  3. Raise Minimum area (Advanced → Small regions) to 128 or 256. Every speck left in the image becomes a tiny closed contour the machine will dutifully visit.
  4. Choose DXF in the Format row.

Edges or filled shapes?

Optimize for decides what the DXF contains:

  • Cutting & engraving draws every boundary exactly once. For profile cutting on a laser, plasma, waterjet, or router — where the tool follows lines — this is the one. Neighbouring regions share a single line, so nothing is cut twice.
  • General use writes each region as a filled area. It suits software that works with areas rather than lines — fills for engraving, pockets for a router. How CAM programs handle filled regions varies, so try a small file in yours first.

Set the size and units

Under Advanced → Output size, choose Custom and type the finished width — say 300 mm — leaving the height empty so it follows the proportions. The panel shows the exact size the file will be written at.

Then check Units in the DXF section: mm (the default), cm, in, or pt. The unit is declared in the file’s header, so CAD software opens the drawing at the right scale. Keep the two consistent — size in millimetres, units in millimetres.

Cleaner geometry: real lines and arcs

Traced outlines are built from Bézier curves, and most DXF readers prefer lines and arcs, so curves are flattened to lines and arcs when the DXF is written. Two settings under Advanced → Detail make that geometry much cleaner:

  • Fit to lines & arcs refits straight edges as true lines and round features as true arcs before anything is written. A hole comes out as arcs rather than dozens of tiny segments, and a straight edge as one line — smaller files and smoother toolpaths. If your software struggles with ellipses, switch off Allow elliptical arcs to keep to lines and circular arcs.
  • Refine curves to color edges places boundary points on the real edge in the image rather than on the pixel grid, so contours follow the design, not the staircase.

Layers by color

Groups become DXF layers. With filled shapes, set Group by to Color (under Advanced → Shape output, or pick the Easy editing preset) and each color arrives on its own layer — handy for mapping colors to operations: black for through-cuts, red for engraving.

The Edges draw style has no grouping: an edge sits between two colors, so it can’t belong to either one. If you need cut lines on separate layers, trace each part of the design separately, or assign the lines to layers in your CAD program.

Importing the DXF

  • AutoCAD, LibreCAD, QCAD, DraftSight: open the DXF directly.
  • Fusion: in a sketch, use Insert → Insert DXF and confirm the unit.
  • LightBurn: File → Import, or drag the file onto the workspace.
  • Vectric VCarve and Aspire: import it as vectors, then build toolpaths from the contours.
  • Inkscape opens DXF too, which is handy for a last-minute edit.

Before you cut

  • Measure a known dimension right after importing. If it’s off by 25.4 or 10, the units disagree somewhere.
  • Look for tiny closed shapes. Delete them, or go back and raise the minimum area.
  • Leave offsets to the CAM. The DXF is the design line; kerf and tool-radius compensation — cutting inside or outside the line — belong in your CAM or laser settings.
  • Test on scrap before cutting the good material.

Making cut files for a Cricut or a vinyl cutter rather than CAD? Making cut files covers blade cutters and layered vinyl.