Craft Tools

Image to SVG or DXF cut file

Your logo is a picture and the cutter wants outlines: drop the image, set the threshold and take away an SVG or DXF file at the right size.

/ 255

A pixel darker than this level is cut. The higher the threshold, the more the black area grows.

in
pixels

Largest gap allowed, in image pixels, between the exact outline and the simplified one. 0 keeps every vertex.

What this tool is for

A laser cutter, a vinyl cutter or a CNC router follows lines, not colored pixels. A logo saved as a PNG has to become closed outlines before it becomes a cut file. The tool does it in your browser: it separates black from white using a threshold, finds every outline, holes included, and then simplifies the outlines so the machine does not follow every tiny stair-step of the pixels.

What happens, in order

  1. The image is scaled down to 1,000 pixels wide at most, then converted to grayscale.
  2. Every pixel darker than the threshold is marked “to cut”. Tick the box to trace the light areas instead.
  3. Outlines are traced along the pixel edges, so they match the black area exactly before any simplification.
  4. Each outline is simplified with the Ramer–Douglas–Peucker method: a vertex is dropped only if the outline stays within your smoothing distance of the simplified one.
  5. The drawing is scaled to the width you chose, in inches, and written as an SVG (even-odd fill, so holes stay holes) and as a DXF (one closed polyline per outline, on a layer named CUT).

Settings and traps

A clean logo on a plain background gives a tidy drawing with smoothing close to 1 pixel. A photograph does not trace well: it produces thousands of tiny outlines, and while a lower threshold and stronger smoothing help, a stencil is much easier to make from a drawing. Think about bridges: the center of an “o” or the dot of an “i” falls out unless something holds it. Specks smaller than 4 pixels are ignored. The DXF file written here has no unit header, so import it as inches. This tool writes the files for software such as LightBurn, Inkscape or the Glowforge app, but none of them has opened a file from it yet: open the drawing and check its size before you start the machine.

Formula used and sources

Threshold: a pixel is black if gray < threshold, with gray = 0.299 R + 0.587 G + 0.114 B. Outlines: edges between a black pixel and a white pixel, joined into loops.

Simplification: the point farthest from the segment is kept if its distance exceeds the tolerance ε, and the method repeats on each side. Scale: final width ÷ image width.

Other tools on this site