There are times you will need to convert a raster file to a vector file in order for us to laser-cut it. This is easier than it sounds, and we’re going to show you how to easily convert a raster file to a vector file using Inkscape, a totally free design software.
First, why do we require vector files?
We require vector files for laser-cutting because vectors act as a set of coordinates for the laser. These coordinates are understood by the laser because they are determined through a set of mathematical equations, unlike raster files which are just graphic images, or pixels. A raster file’s clarity depends on its resolution and it doesn’t scale correctly, so the laser won’t be able to “find” the true edge lines of your part. It will reject all files that are not vectors.
If you still need some help understanding why you need to convert files for laser-cutting, check out our article, “Why We Require Vector Files for Laser-Cutting.”
Okay, let’s get started!
Create a new document in Inkscape and import your raster image. If you use the “edit path by nodes” tool (F2), you’ll see that we have no nodes to select. You’ll also notice the edges are a little fuzzy or pixelated. We can fix that!
With your raster image selected, go to the Path menu and select Trace Bitmap (Shift+Alt+B).
In the dialog, select “Color Quantization,” and set your Colors to 2. You’ll want to adjust the rest of the settings according to your image. Keep an eye on the window that shows what you’re changing as you change it. When you’ve got everything dialed in, click “Update” and “OK”, and close this dialog.
Your image is now a vector object with paths and nodes. You need to delete the original image. It’s hiding behind the traced version. Select your vector object and move it to the side. You can now delete the raster image.
Select your object with the Edit path by nodes tool (F2) again. Depending on the quality and complexity of your image, you may have an unwanted amount of nodes. You can see that this image most definitely has way too many. We need to get rid of these because the laser follows a map from point to point (node to node.) If a path has too many nodes, it will not be usable for manufacturing. If you can simplify the laser’s path, you are going to get better results.
The good news is there is a very simple solution. Select your object and go to the “Path” menu again. Select “Simplify” (CTRL+L). This will reduce the amount of nodes.
The next thing you’ll want to do is inspect the edges of your object to make sure things are straight and smooth. This again will depend on the quality and complexity of the image you began with. Zoom in tight and view your image in Outline display mode.
The lines for this object are pretty bumpy and jagged. It’s important to clean these up because the laser will cut them exactly as seen here. There are a few ways to do this.
Select your object again with the “edit path by nodes” tool (F2). Along the top you’ll notice there are still a lot of extra nodes. You can select them by shift+clicking the nodes you want to target. They will turn blue once selected. Now, you can click the “delete selected nodes” button in the top toolbar.
The extra nodes have been removed which resulted in a much smoother curve.
Another way to smooth curves and lines is by adjusting the node handles. Click F2 to activate the “edit path by nodes” tool. Select a node and grab one of the handles. These will turn red when selected. Moving these handles will adjust the curve of the lines attached to that node.
Once you’ve finished cleaning up your edges, you’ll want to check the size of your object and make sure it’s to scale. Using the “select and transform objects” tool (F1), select your object. You can scale it up and down by dragging the outer arrows. Holding the CTRL key as you drag will scale your object proportionally. You can also just type in your desired dimensions in the top toolbar. Make sure your dimensions are in inches so it will import to the laser correctly.