How to vectorize a scanned drawing and convert it to DWG
The screenshots show the Spanish interface; commands and options are given as they appear in the English version of the program.
A scanned drawing is a picture: pixels, not lines. You can trace over it by hand, but on a long drawing that takes
hours. The other route is to vectorize it: turn the ink in the image into polylines, circles and
arcs, and recognize the labels with OCR so they become editable text. In LinceCAD both are done
inside the program, with VECTORIZAR and OCRIMAGE, and the result is saved as DWG.
If your drawing is not a scan but a PDF exported from a CAD program, there is no need to vectorize: it contains
the vectors and PDFIMPORT converts them directly. We explain it in how to convert a
PDF to DWG.
Which scans give the best results
- Line drawings, with black strokes on a light background. Hatches, patterns and photos are vectorized as many small outlines.
- Good contrast, with no damp stains or sharp folds. Scanning in black and white or grayscale usually gives less noise than in color.
- Straight and to scale: a skewed drawing, or one photographed at an angle, can be corrected, but the less there is to correct, the better.
The image can be PNG, JPEG, BMP, TIFF, GIF or WebP.
Step by step
1. Attach the image on its own layer
Create one layer for the scan and another for the vectorized result (for example SCAN and
VECTOR): that way you can later turn the image off and see only the entities. With the scan layer
current, type IMAGEATTACH (or click the button on the Insert tab, Image and
tracing group), choose the file and specify the insertion point, scale and rotation. The image is not
copied into the drawing: its path is saved.

2. Clean up the image if needed
IMAGEEDIT retouches the pixels without touching the original file (it saves a copy
<name>-ed.png and relinks the image to it). The most useful operations before vectorizing:
- Threshold: turns the image black and white at the brightness limit you specify.
- Despeckle: removes isolated dots from the scan with a 3×3 median filter.
- Invert, for drawings with light strokes on a dark background, and Rotate 90, 180 or 270 degrees.
If the drawing was photographed at an angle, IMAGEPERSP uses four corners to straighten what should
be rectangular. To remove margins or the title block, use IMAGECROP.
3. Bring the image to its real scale
Vectorized entities are created where the image is and at its size, so it is best to scale it first. With
GEOREFIMAGE you pick two or three recognizable points on the scan (the ends of a known dimension, a
grid line intersection) and give them their real position; the image is moved, rotated and scaled without being
distorted. If you prefer to do it afterwards, SCALE with the Reference option, or
ALIGN, does the same with the entities.
4. Vectorize
Make the VECTOR layer current, type VECTORIZAR (or click Vectorize
image) and select the image. Before running it you can adjust the parameters; Enter runs it with the
current ones:
| Parameter | What it does |
|---|---|
| Threshold | Binarization limit (0-255): a pixel darker than the threshold counts as ink. |
| Fit (tolerance) | How far an outline can deviate, in pixels, and still be a line, circle or arc, and how much polylines are simplified. |
| Minimum | Discards strokes shorter than this size in pixels (8 by default). Useful for removing noise. |
| Centerline | Thins strokes to one pixel and follows their center, instead of going around the outline. Intended for line drawings with thick strokes. |
| Join | Joins broken strokes whose ends almost touch. |
Each outline is fitted by least squares: if it is nearly circular you get a circle or an arc, if it is nearly straight a line, and otherwise a polyline. The entities take the current layer and color.
5. Recognize the text with OCR
Switch to a layer for the text and type OCRIMAGE (or RECOGNIZETEXT), select the image
and press Enter. One text (TEXT) is created for each recognized line, at its position, with the height measured
from the pixels and the rotation of the line, on the current layer and text style. The OCR engine is built into
the program: the first time, it downloads its two models (about 12 MB) to the configuration folder and then
reuses them. Offline, if you have tesseract installed, it is used as a fallback.

6. Check and save
Turn off the SCAN layer to see only the entities, erase what is not needed and check the
measurements against a known dimension. Then save the drawing as DWG (or DXF) with SAVEAS.
A real example
For the screenshots we used a floor plan of a home that we drew ourselves: a 1600 × 1000 pixel image with noise,
specks and a slight rotation, so that it looks like a scan. With the default parameters, VECTORIZAR
created 95 entities (71 polylines and 24 circles). OCRIMAGE read all six labels correctly (SALON,
COCINA, ASEO, DORMITORIO, TERRAZA and “PLANTA BAJA ESCALA 1:100”) and created three extra texts: it read the round
column as a “C” and two stray strokes as “6” and “RO”. Always check what comes out of the OCR.
The letters in the scan are vectorized too, as outlines, and overlap the OCR text. Raising Minimum to 120 pixels brought the vectorization down to 28 entities and left the letters out; on the other hand, a high value can lose small details, so it is best to try it on a copy.
Limitations
- It is not an exact redraw. Accuracy depends on the scan: a stroke several pixels thick gives a measurement with that much uncertainty. For a survey or construction drawings, check the measurements that matter.
- Thick strokes come out as outlines. A wall drawn with a thick stroke is vectorized as its outline (two lines). Centerline mode follows the axis of the stroke, but on very noisy scans it can produce many small entities: try it after cleaning the image.
- Everything goes on one layer.
VECTORIZARdoes not tell walls, furniture or dimensions apart: everything goes on the current layer and has to be sorted out afterwards. - Dimensions are not recognized as dimensions. The OCR turns their figures into text, and the dimension lines are vectorized like any other line.
- OCR for the Latin alphabet only (Spanish and English), in preview. Symbols and short strokes can be read as letters.
- Hatches and patterns produce many small entities. It is better to erase them in the image or
discard them with Minimum, and hatch again with
HATCH.
Frequently asked questions
Do I need another program for the OCR? No. The OCR is built into LinceCAD; tesseract is only used as an offline fallback, if you already have it installed.
What if the drawing is of a land parcel? Before vectorizing a scanned cadastral plan, check whether the official mapping will do: how to import the Spanish cadastral map and the PNOA orthophoto into a DWG.
Can it be automated for many drawings? LinceCAD has AutoLISP, scripts and a local API; we cover them in how to automate DWG drawings with Python.
Does it work on Linux? Yes, the same as on Windows: how to open and edit DWG files on Linux.
Vectorization, OCR and PDF to DWG come as standard in LinceCAD, with a perpetual license. Download · See pricing · Images and all other features.