PNG to DXF converter
Trace a PNG, JPG, WEBP, GIF, BMP or HEIC image into outlines and write them as a DXF for laser cutting, CNC routing or plasma — with the threshold, the detail level and the finished part width all under your control.
What vectorising can and cannot do
A PNG is a grid of coloured pixels and a DXF is a list of coordinates, so converting one to the other means tracing: following the boundary between colour regions and writing each boundary out as a closed polyline. That works beautifully on a black silhouette, a logo or a scanned line drawing, and it produces thousands of unusable blobs from a photograph — which is why this page shows you exactly what the tracer sees before it traces, and lets you move the threshold until the shape is clean. You then set the width you want the finished part to be, because a bitmap has no physical size at all, and the DXF is written with that unit recorded in its header so a cutter opens it at the size you meant.
Key facts about PNG to DXF converter
| Tracer | imagetracerjs 1.2.6, a public-domain pure-JavaScript vectoriser — no WebAssembly model and no remote service |
|---|---|
| Inputs accepted | PNG, JPG, WEBP, GIF, BMP and HEIC (iPhone photos are decoded first with libheif compiled to WebAssembly) |
| Black-and-white mode | a luminance threshold from 1 to 254 with an invert switch, previewed live before you commit to a trace |
| Colour mode | 2 to 24 quantised colours, each becoming its own set of contours and its own DXF layer |
| Background handling | the palette entry closest to the average of the four corner pixels is dropped, so you do not get a rectangle around the whole image |
| Detail presets | three — line art (ignores contours under 8 px), maximum detail (keeps everything, tightest curve fit) and smooth (fewest points) |
| Trace resolution cap | 2 megapixels; larger images are resampled first and the page tells you the size it actually traced at |
| Output size | you set the finished width in mm, cm, inches or raw pixels — the height follows the image's aspect ratio |
| Contours | written as closed polylines; a hole inside a shape is traced as its own contour rather than being merged into the outline |
| Measured example | a 400 × 300 logo traces to 2 contours and 57 vertices in about 22 ms in the browser |
| File cap | 30 MB per image |
| What tracing cannot recover | original dimensions, text as text, layer structure, or anything softer than the pixel grid it is reading |
What happens to your file
The image is decoded by the browser itself and drawn onto a canvas in this tab, and the tracer reads the pixels straight off that canvas. imagetracerjs is plain JavaScript bundled into the page, so there is no model to download, no WebAssembly blob fetched from a CDN and no API call — the pixels never leave the tab. The one thing that does come over the network is code, not data: opening the tool fetches the page's own JavaScript chunk from toolchamp.app, and dropping an iPhone HEIC file additionally fetches a roughly 2.5 MB WebAssembly decoder chunk, also from toolchamp.app. Neither request contains any part of your image. The traced contours and the finished DXF live only in tab memory until you download them; reloading the page discards both.
About this tool
- 1
Start with the cleanest image you have
A solid black shape on white traces perfectly. A photo, a gradient or a JPEG with compression noise around the edges traces into hundreds of ragged contours no cutter can use.
- 2
Drop the file
PNG, JPG, WEBP, GIF, BMP or an iPhone HEIC. If it is over 2 megapixels the page resamples it for tracing and tells you the resolution it will work at.
- 3
Move the threshold until the preview is right
The left panel shows exactly what the tracer will see — pure black and pure white, nothing in between. Push the slider until the shape is solid and the background is clean, and use Invert if the subject is the light part.
- 4
Pick a detail preset
Line art ignores specks under 8 pixels and is what you want for logos. Maximum detail keeps every contour. Smooth produces the fewest points and the softest corners.
- 5
Press Trace image
Tracing is the expensive step so it runs on a button, not on every slider move. The contours appear in the preview below with a count of contours and vertices.
- 6
Set the finished width and unit
This is the one thing the image cannot tell you. Type the width the part should actually be, choose mm, cm or inches, and the whole drawing is scaled to it.
- 7
Choose R12 or R2000 and download
R12 is the safest choice for older machine software. The banner reports the polylines, vertices and layers written into the file.
| Input formats | image/png, image/jpeg, image/webp, image/gif, image/bmp, plus .heic and .heif converted to JPEG first |
|---|---|
| Maximum file size | 30 MB |
| Maximum traced resolution | 2,000,000 pixels — a 1600 × 1250 image; anything larger is downscaled before tracing |
| Output | ASCII DXF R12 (AC1009) or R2000 (AC1015), closed polylines, with $INSUNITS set |
| Layers | one per traced colour, named TRACE_RRGGBB — or everything on layer 0 for a single-material cut |
| Transparency | alpha is composited onto white before the threshold is applied, so a transparent PNG behaves like one on a white background |
| Kerf and offset | not applied — the contour follows the pixel boundary exactly; apply tool compensation in your CAM software |
| Browser support | current Chrome, Edge, Firefox, Safari and Opera |
| Offline | works with no network once the page has loaded (HEIC needs its decoder chunk fetched once) |
- Clean the image before tracing, not after. Ten seconds with a paint bucket in any image editor beats deleting three hundred stray contours in CAD.
- JPEG compression puts a halo of intermediate greys around every hard edge, and the threshold turns that halo into a wobbly outline. If you have the PNG, use the PNG.
- Every traced contour is closed, so a letter like O comes out as two contours — outer and inner. That is correct, and it is what a cutter needs to know which part falls out.
- Scanned line art often traces better inverted: scan at high contrast, invert, and trace the dark strokes rather than the white paper between them.
- If the result has thousands of points, try the smooth preset before you lower the resolution — it fits longer segments to the same boundary rather than throwing detail away.
- The contour follows the pixel boundary exactly; it has no idea about the width of your laser kerf or your router bit. Apply tool compensation in the CAM software, not here.
- Trace at a sensible size and scale in CAD rather than the other way round — a 30-megapixel photo downsampled to 2 MP loses nothing the tracer could have used anyway.
- Live threshold preview showing exactly what the tracer will see
- Black-and-white or up to 24 quantised colour regions
- Automatic background-colour removal from the corner pixels
- Three detail presets from line art to maximum detail
- Finished part width set in mm, cm, inches or pixels and written into $INSUNITS
- One DXF layer per traced colour, or everything on layer 0
- Turning a customer's logo PNG into a laser-cuttable outline for an acrylic sign.
- Getting a hand-drawn shape from a phone photo into CNC-ready geometry.
- Making a plasma-cutting path from a silhouette graphic.
- Converting a scanned template or pattern into a DXF you can dimension in CAD.
- Producing a vinyl-cutting path from a two-colour graphic.
- Building a stencil outline from black-and-white artwork.
Related tools
View allWorks well with this5
Other PNG tools12
Updated