PNG to DXF Converter
Turn a PNG logo, stencil or silhouette into a DXF you can cut. Set the size in mm or inches. Your PNG stays on your device.
https://flxcode.com/png-to-dxf/
or drop it here, or paste with Ctrl+V
PNG, JPG, WebP, GIF, BMP or AVIF. It never leaves this device.
Pixels darker than this become shapes. Lower it if too much is cut out.
Up to this many. Each color becomes its own layer.
Higher drops more tiny shapes.
Blurs rough edges before tracing. Rounds sharp corners.
How closely straight pieces follow a curve.
-
Outline tracing only. A thick line becomes a shape with two edges, not one center line (no single-stroke tracing). A photo needs strong contrast to give clean shapes.
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.
Problem or idea? Email us
Quick start
- Choose your PNG, drop it on the page, or paste it with Ctrl+V.
- Dark shapes on a light or see-through background work best. If the wrong part is cut, press Invert.
- Set the width of the finished part and the unit. Raise Speck removal if you see tiny dots in the preview.
- Press Download DXF and open it in your laser or CNC program.
Why a PNG logo suits a DXF
A logo or stencil is already shapes with hard edges, so it traces cleanly. A PNG with a see-through background is even better: see-through pixels are never cut, so you do not need to remove a white box first.
Two limits. The DXF has the outline of each shape, not a center line, so a thin pen stroke becomes a thin loop. And a stencil letter such as O or A has an island in the middle that falls out when cut. This tool does not add bridges to hold islands in place, so add them in your program or pick a stencil font.
Worked examples
These pictures are made in code with known shapes, and turned into DXF by the same engine as the tool above, when this page was built. The numbers are what the tool gives you.
A stencil-like picture, 80 x 60 px: a black 20 x 20 px square and six black 4 x 4 px dots on white. Width 100 mm. Only Speck removal changes:
| Speck removal | Drops outlines under | Polylines | Points |
|---|---|---|---|
| 0 | 0 edge points | 7 | 100 |
| 1 | 4 edge points | 7 | 100 |
| 2 | 10 edge points | 7 | 100 |
| 3 | 24 edge points | 1 | 4 |
| 4 | 48 edge points | 1 | 4 |
| 5 | 96 edge points | 0 | 0 |
A 4 x 4 dot has 16 edge points and the 20 x 20 square has 80. Up to level 2 everything is kept: the square and six dots, 7 polylines. At level 3 the limit is 24, the dots go and only the square stays. At level 5 the limit is 96, so even the square is dropped and nothing is left.
- Level 2: 7 polylines
- Level 3: 1 polyline
The size comes from the width you type
The shapes of the same picture at three widths. The height follows the picture and crop is on, so the width is the width of the square and the farthest dot:
| You type | Shape width in the file | Shape height in the file | $INSUNITS |
|---|---|---|---|
| 50.0352 mm | 50.035 mm | 36.45 mm | 4 |
| 100 mm | 100 mm | 72.868 mm | 4 |
| 4 inches | 4 in | 2.915 in | 1 |
The pixel count does not matter. The same picture at 160 x 120 px, twice the pixels in each direction, set to 100 mm: the height is 71.88 mm, and at 80 x 60 px it is 72.87 mm. A PNG that claims 300 DPI is treated the same.
A transparent PNG
A red 10 x 10 px square on a see-through 30 x 20 px picture, set to 50 mm wide.
| Measure the width on | Polylines | Square in the file |
|---|---|---|
| the shapes (crop on) | 1 | 50 by 50 mm |
| the whole picture (crop off) | 1 | 16.67 by 16.67 mm |
The see-through area is not cut in either case. With crop off the 50 mm is the width of the picture, margins included, so the square is 10 of 30 px of it, 16.67 mm.
The start of the DXF of the square, 871 bytes in all:
0
SECTION
2
HEADER
9
$ACADVER
1
AC1009
9
$INSBASE
10
0.0
20
0.0
30
0.0
9
$EXTMIN
10
0.0
... What happens to your PNG
The PNG is read as pixels. See-through pixels become background. Every other pixel is turned to a brightness, and the ones darker than the Threshold are cut shapes. The page then finds the border of each shape and each hole.
The DPI stored in a PNG file is ignored. A PNG has pixels, not a real size, so the size comes only from the width you type. If the logo should be 60 mm wide, type 60 and pick mm. The shapes are placed with their lower left corner at 0,0, with crop on, so they land where you expect on the bed.
Numbers this uses
- Transparent pixels (alpha under 128 of 255) are background and never cut. Everything else is judged by brightness against the Threshold (1 to 255, start 128).
- Speck removal 0 to 5 drops outlines shorter than 0, 4, 10, 24, 48, 96 edge points, about their perimeter in pixels. A 4 x 4 px dot has 16 edge points.
- The PNG's pixel size does not set the DXF size. Only the width you type does. The longer side is traced at 1000 px at most.
- Curve accuracy 0.02, 0.05 or 0.2 mm: the largest gap between a curve and its straight pieces.
- 1 in = 25.4 mm. Width from 0.1 to 100000 mm.
- File: DXF R12 (AC1009), one closed POLYLINE per outline, $INSUNITS 4 for mm and 1 for inches.
- Tracer: imagetracerjs 1.2.6 by András Jankovics, public domain (Unlicense). We use its shape finding and write the DXF ourselves.
Privacy
The picture is traced in your browser and is not uploaded or stored. Units, mode and slider settings can go in the share link; the width you type, the picture and its name never do. The tool counts events without cookies, such as "DXF saved", and never a file name, size or point count (details). Licences: Open source used on this site.
FAQ
How do I convert a PNG to DXF?
Choose the PNG, check that the red preview paths sit on the shapes you want, type the finished width and the unit, and press Download DXF. The PNG is traced in your browser, and nothing is uploaded.
Why is the wrong part cut: the background and not the logo?
A light logo on a dark background reads as the opposite of what you want. Press Invert, and the light areas become the shapes. You can also move Threshold until the preview looks right.
What size will the DXF be? My PNG says 300 DPI.
The DPI inside a PNG is ignored. The size is the width you type, in mm or inches, and the height follows the picture. A 1000 px PNG and a 100 px PNG of the same logo give the same DXF size if you type the same width.
Can I use it for laser cutting a stencil?
Yes, with one catch. Letters with a closed middle, such as O, A, B, D and 8, lose that middle when cut, because nothing holds it. This tool does not add bridges. Use a stencil font, or draw bridges in your laser program before you cut.
How can I clean up a PNG with small dots or rough edges?
Raise Speck removal to drop tiny shapes, and add Smoothing 1 or 2 to blur rough edges before tracing. Both change the preview at once. Smoothing also rounds sharp corners a little, so use as little as works.
Is the DXF too big or heavy for my machine?
The stats line shows the number of points and the file size. A simple logo comes out at tens to a few hundred points. If yours is far more, use Curve accuracy "Coarse" and a higher Speck removal.
More from FLXCode
- Image to DXF ConverterTrace a PNG, JPG or WebP into a DXF with closed outlines at a real size in mm or inches. Nothing is uploaded.
- PNG to SVG ConverterTrace a PNG logo or icon into an SVG you can scale to any size. Choose the colors. Nothing is uploaded.
- Image to SVG ConverterTrace a PNG, JPG, WebP or GIF into an SVG. Tune colors, smoothing and detail. Nothing is uploaded.
- JPG to SVG ConverterTrace a JPG into an SVG of colored shapes, with smoothing for JPEG noise. Nothing is uploaded.