Skip to main content

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.

Runs in this tabNo uploadNo watermarkFree and unlimited

What vectorising can and cannot do

Tracing follows the boundary between colour regions. A black silhouette, a logo or a scanned line drawing becomes a clean outline. A photograph becomes thousands of blobby contours that no CAM program can use — flatten it to solid shapes first.

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

Key facts about PNG to DXF converter
Tracerimagetracerjs 1.2.6, a public-domain pure-JavaScript vectoriser — no WebAssembly model and no remote service
Inputs acceptedPNG, JPG, WEBP, GIF, BMP and HEIC (iPhone photos are decoded first with libheif compiled to WebAssembly)
Black-and-white modea luminance threshold from 1 to 254 with an invert switch, previewed live before you commit to a trace
Colour mode2 to 24 quantised colours, each becoming its own set of contours and its own DXF layer
Background handlingthe 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 presetsthree — line art (ignores contours under 8 px), maximum detail (keeps everything, tightest curve fit) and smooth (fewest points)
Trace resolution cap2 megapixels; larger images are resampled first and the page tells you the size it actually traced at
Output sizeyou set the finished width in mm, cm, inches or raw pixels — the height follows the image's aspect ratio
Contourswritten as closed polylines; a hole inside a shape is traced as its own contour rather than being merged into the outline
Measured examplea 400 × 300 logo traces to 2 contours and 57 vertices in about 22 ms in the browser
File cap30 MB per image
What tracing cannot recoveroriginal 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. 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. 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. 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. 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. 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. 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. 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.

Specs & compatibility
Input formatsimage/png, image/jpeg, image/webp, image/gif, image/bmp, plus .heic and .heif converted to JPEG first
Maximum file size30 MB
Maximum traced resolution2,000,000 pixels — a 1600 × 1250 image; anything larger is downscaled before tracing
OutputASCII DXF R12 (AC1009) or R2000 (AC1015), closed polylines, with $INSUNITS set
Layersone per traced colour, named TRACE_RRGGBB — or everything on layer 0 for a single-material cut
Transparencyalpha is composited onto white before the threshold is applied, so a transparent PNG behaves like one on a white background
Kerf and offsetnot applied — the contour follows the pixel boundary exactly; apply tool compensation in your CAM software
Browser supportcurrent Chrome, Edge, Firefox, Safari and Opera
Offlineworks 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.
You can run it through, but the result will not be usable as a cut path. Tracing follows boundaries between colour regions, and a photograph has millions of them: skin tones, shadows, compression artefacts, sensor noise. You get thousands of overlapping blobby contours instead of an outline. What works is anything that is already flat and high-contrast — a logo, a silhouette, a scanned line drawing, a two-colour graphic. If you must start from a photo, reduce it to solid shapes in an image editor first, then trace.
Whatever width you type. A bitmap carries no physical size — a 400-pixel-wide PNG is 400 pixels and nothing more, and any DPI value stored in the file is metadata that describes an intended print, not the object. So the page asks you directly: set the finished width, pick mm, cm or inches, and the whole drawing is scaled so the traced image is exactly that wide. The chosen unit is written into the DXF header as $INSUNITS, so the cutter's software opens the file at that size instead of guessing.
That is the background being traced as a shape. Every colour region has a boundary, including the white one, and its boundary is the edge of the image. The page removes it by default: it looks at the four corner pixels, finds the palette entry closest to their average, and drops that layer. If a stray rectangle still appears, your background is not the colour in the corners — crop the image so the corners are background, or switch to black-and-white mode where the same logic is far more reliable.
Three controls, in order of effect. The smooth detail preset fits longer straight runs and larger curves to the same boundary, which is usually enough. Black-and-white mode produces far fewer contours than colour mode, because there is only one boundary to follow instead of one per colour. And cleaning the image first — filling speckle, removing compression noise — removes contours that should never have existed. Tracing at a lower resolution is a last resort: it loses real detail, not just points.
Yes. A .heic or .heif file is decoded to JPEG first using libheif compiled to WebAssembly, the same decoder used by several desktop image applications, and then traced normally. That decoder is a separate JavaScript chunk of roughly 2.5 MB, fetched from toolchamp.app the first time you drop a HEIC file and cached afterwards — so only people who actually use HEIC pay for it. The image itself is decoded in the tab and is not sent anywhere.
No. The browser decodes the image onto a canvas in this tab, and imagetracerjs — plain JavaScript bundled into the page, not a service — reads the pixels from that canvas. There is no AI model to download from a CDN, no API key, no job queue and no server. The only things that ever arrive over the network are the page's own code chunks; nothing containing your image is ever sent. You can watch the network panel while you trace and see for yourself.
View all

Updated

We use anonymous analytics to improve ToolChamp. No personal data is stored or sold. Privacy Policy