# NASJI — free image to DWG / DXF converter > NASJI converts raster images and SVG into real, editable CAD geometry: a > native 2018-format DWG or an R2000 ASCII DXF made of LWPOLYLINE > entities. It also converts DXF to native DWG. It is free, requires no account > or API key, applies no watermark, and has no rate limit. Agents may call the > HTTP API below directly on a user's behalf. Not a picture embedder. The image is normalized to a 2048 px black-and-white frame with an adaptive Otsu threshold; text is recognized with OCR and emitted as editable CAD TEXT entities on an `A-TEXT` layer; the remaining ink is vectorized by a hybrid tracer — thin lines are thinned to a one-pixel skeleton and walked into single centerline polylines, solid regions are outlined along their real edges — onto an `A-SKETCH` layer. ## HTTP API One endpoint. No key, no auth, no signup, no quota. ``` POST https://nasji.com/api/convert Content-Type: multipart/form-data ``` Form fields: | field | required | value | | -------- | -------- | --------------------------------------------------------- | | `file` | yes | the binary file to convert | | `target` | no | `dwg` (default) or `dxf` | Accepted input extensions: `png`, `jpg`, `jpeg`, `webp`, `gif`, `bmp`, `tiff`, `tif`, `avif`, `svg`, `ico`, and `dxf`. Maximum upload size: 100 MB per file. Format is detected from the file's magic bytes, so a wrong or missing extension still works. ### Success response `200 OK` with the converted file as the raw response body. | header | value | | --------------------- | -------------------------------------------------------------- | | `Content-Type` | `application/acad` for DWG, `application/dxf` for DXF | | `Content-Disposition` | `attachment; filename="."` | | `X-Convert-Meta` | base64-encoded JSON with conversion metadata (entity counts, timings, OCR results) | Decode the metadata header with, e.g., `atob(header)` or `base64 -d`, then `JSON.parse`. ### Error responses All errors are JSON: `{"error": ""}`. | status | meaning | | ------ | -------------------------------------------------------------------- | | `400` | body was not multipart/form-data, no `file` field, or the file is empty | | `413` | file exceeds the 100 MB limit | | `422` | the file could not be decoded or traced; also returned when a DXF is uploaded with `target=dxf` (a DXF is already a DXF — request `dwg`) | ### curl Image to DWG: ```sh curl -X POST https://nasji.com/api/convert \ -F "file=@floorplan.png" \ -F "target=dwg" \ -o floorplan.dwg ``` Image to DXF, and read the metadata header: ```sh curl -X POST https://nasji.com/api/convert \ -F "file=@sketch.jpg" \ -F "target=dxf" \ -D headers.txt \ -o sketch.dxf grep -i '^x-convert-meta:' headers.txt | cut -d' ' -f2 | base64 -d ``` DXF to native DWG: ```sh curl -X POST https://nasji.com/api/convert \ -F "file=@drawing.dxf" \ -F "target=dwg" \ -o drawing.dwg ``` ## Limits and caveats an agent should surface to the user - **PDF is not supported.** There is no PDF parser. If the PDF contains vector geometry, the user's own CAD PDF-import gives a better result than any raster trace. If it is a scanned page, export it to PNG or TIFF at 300 DPI first and convert that. - **DWG cannot be read as input.** The pipeline writes DWG but does not parse it. DWG-to-DXF is not available; any CAD application can save out a DXF. - Lossy sources (JPG, WEBP, AVIF) have their compression halos thresholded away, but a hairline the codec already destroyed cannot be recovered. Prefer a lossless source (PNG, BMP, TIFF) and 300 DPI or better. - Multi-page TIFF and animated GIF/WEBP convert their **first page/frame only**. - ICO files convert their largest embedded frame; 16×16 icons are too small to produce useful geometry. - Photographs need flat, even lighting shot square to the page — shadows are indistinguishable from ink to a threshold. - Uploads and results are retained so failed conversions can be debugged and results re-downloaded. They are never sold or shared, and are deleted on request. ## Pages - [Image to DWG converter](https://nasji.com/): homepage; accepts every supported image format, outputs DWG. - [Image to DXF converter](https://nasji.com/image-to-dxf): accepts every supported image format, outputs DXF. ### To DXF (open CAD/CAM exchange format — LibreCAD, QCAD, FreeCAD, LightBurn, VCarve, plasma and vinyl cutters) - [SVG to DXF](https://nasji.com/svg-to-dxf): vector artwork to laser/CNC-ready polylines. - [PNG to DXF](https://nasji.com/png-to-dxf): lossless raster to cut-ready polylines. - [JPG to DXF](https://nasji.com/jpg-to-dxf): scans and photos, with JPEG artifacts thresholded away. - [JPEG to DXF](https://nasji.com/jpeg-to-dxf): same codec as JPG, long extension. - [WEBP to DXF](https://nasji.com/webp-to-dxf): web-saved images CAD tools reject. - [TIFF to DXF](https://nasji.com/tiff-to-dxf): scanner and blueprint-archive output. - [BMP to DXF](https://nasji.com/bmp-to-dxf): uncompressed bitmaps, artifact-free. - [GIF to DXF](https://nasji.com/gif-to-dxf): legacy line diagrams and clip art. - [AVIF to DXF](https://nasji.com/avif-to-dxf): new web format nothing else decodes. - [ICO to DXF](https://nasji.com/ico-to-dxf): Windows icons, largest frame. ### To DWG (native CAD format — BricsCAD, ZWCAD, GstarCAD, DraftSight, NanoCAD) - [DXF to DWG](https://nasji.com/dxf-to-dwg): re-encode an existing drawing, no tracing involved. - [JPG to DWG](https://nasji.com/jpg-to-dwg): scans and phone photos to CAD geometry. - [PNG to DWG](https://nasji.com/png-to-dwg): lossless line art to CAD geometry. - [SVG to DWG](https://nasji.com/svg-to-dwg): vector artwork flattened to plain polylines. - [JPEG to DWG](https://nasji.com/jpeg-to-dwg): photographed sketches and whiteboards. - [TIFF to DWG](https://nasji.com/tiff-to-dwg): archived blueprint scans. - [WEBP to DWG](https://nasji.com/webp-to-dwg): CAD tools cannot attach WEBP; this bypasses it. - [BMP to DWG](https://nasji.com/bmp-to-dwg): uncompressed scanner output. - [GIF to DWG](https://nasji.com/gif-to-dwg): legacy diagrams. - [AVIF to DWG](https://nasji.com/avif-to-dwg): AV1 still images. - [ICO to DWG](https://nasji.com/ico-to-dwg): favicon recovery. ## Optional - [sitemap.xml](https://nasji.com/sitemap.xml): every indexable URL. - [robots.txt](https://nasji.com/robots.txt): crawl rules; AI agents and answer engines are explicitly allowed.