Tutorial: 2.6 Tracing Images

Video Transcript

Example drawing: Hammer.dxf

Example image: Hammer.png

In this tutorial, we will look into ways to trace or vectorize images in QCAD.

Tracing images can be useful for recreating technical drawings from a scan or photo or for vectorizing sketches.

We have already learned how to insert and align an image in the previous tutorial.

We have inserted this image of a hammer and aligned it to the desired size and angle.

We now want to trace the outline of the hammer.

To make our tracing easier to see, we can fade the image into the background before we start.

To fade the image, We select it and change its fade property.

A value of 0 means that the image is opaque, a value of 100 would mean that the image would be completely transparent.

We set the value to 50 to fade the image by 50%.

Next, we add a layer for our tracing.

Our vector tracing of the bitmap will be placed on this layer.

We make the layer red to create some contrast with our image.

We could now use our regular CAD tools to trace the image manually using lines, arcs or splines.

To trace a well prepared simple image such as this, we can also use the built in tracing tool of QCAD.

We can find the image tracing tool in the draw menu.

This shows the image tracing dialog with a preview of our bitmap.

We can click the update button at the top to show a preview of our tracing in red.

We can immediately see that the various colors of the image are getting in the way of tracing the outline of the hammer.

We are not interested to trace the wood pattern or the light reflection and other colored details of the hammer.

To solve this, we can switch on monochrome preprocessing to trace only the relevant shape of the hammer.

In this mode, the image is converted to a black and white image.

The conversion to black and white can be either based on the transparency (also referred to as Alpha) or the brightness of pixels.

Since this image has a white background and not a transparent one, we choose the brightness option.

We can now use the slider to adjust the brightness threshold when converting the image to black and white.

If we set the threshold too low, there are unwanted tracings from bright parts of the object.

If we set the threshold too high, there might be tracings of minor color variations in the background.

The goal is to set the threshold in such a way, that the silhouette of the object is shown as clearly as possible.

If we are satisfied with the preview of the image, we can update the preview of the tracing again.

We click OK to confirm and trace the image in our drawing.

QCAD adds the trace of the image to our drawing as polylines on our current layer.

We can also hide the image layer now to see only the tracing.

In some cases, this might already exactly be what we needed. In other use cases, this might just be a starting point we can work with.

Keep in mind that an automatic trace of an image is usually not very precise.

So this is by no means a simple way to turn any photo into a CAD drawing.

However, auto tracing does have its uses when precision is not an issue for example to create a foam insert for a tool box or a drawer as shown here.

You should now know how to automatically trace well prepared images in QCAD.

Be sure to practice this with your own installation.

Thank you for watching this QCAD tutorial.