How to create a GCode file from a JPG or DXF
In this tutorial you will learn how to create a GCode file from a picture.
If you already have a DXF file go to the second point “Generate the GCode from DXF”, else start at the first one.
- Create a DXF from JPG
Open your picture with Inkscape. You have to convert it in bitmap, go in “Path->Trace Bitmap…” or use the shortcut “Shift+Alt+B”.
A new window opens, clic on your picture, it will select it, then clic on “OK” on the new window. On the right part, your picture appears with low resolution but it’s okay, don’t worry. Close this window.
Now you have your original picture and the bitmap just on it. Clic on it and remove the original one. To make a difference between them, the original is less clear than the bitmap trace.
Click on “Save as…” in “File”, then choose “.dxf” in “Save as type” and “Save”. Now you have your picture in DXF file.
- Generate the GCode from DXF
Open DXF2GCODE, then open your DXF file. On the right part, there is a preview of the final drawing and on the left part, you can see the different shape needed to draw. You can choose if you want to keep them all or just select some.
In “Options” you can Scale you drawing if you want.
When you are ready, you have to clic on “Export->Export Shapes” or use shortcut “Ctrl+Shift+E”. The software will generate a “.ngc” file. It’s the GCode.
- Improve the GCode
You can improve your GCode, using Notepad++ for “.ngc”.
If you generate GCode to use it for the Makeblock XY plotter for the weather, you have to change the extension of the file and replace “.ngc” by “.cnc”. Just click on the extension in the file name and change it. Use Notepad++ because you have to edit the file and delete all the blank line and all the text other than the Gcode. You have to delete all the space in the document, you can use “search and replace” to do it quickly.