Grbl Gcode Laser Engraving With Software





Introduction: Grbl Gcode Laser Engraving With Software

I made this instructable because I couldn't find software for engraving images with G-code controlled laser. I tried inkscape with extenstions, but this isn't what I expected. I want to engrave photos like attached one, make PCBs etc. So I wrote app in Matlab, which I use commonly on my university. I call it imGcode I want you to give it a try. It is standalone executable, with all libraries attached, so you will only need to install one file and it should work.

You will need laser with grbl or other Gcode controlled laser. It have to have laser PWM controlled by S code.

App is here:

Step 1: ImGcode

App is quite simple. It'll ask you for image (most file formats should work, if something fails convert it with MS Paint to bmp). Image can be bw or rgb. Then It'll ask for output file in .nc format. after that dialog-box will appear. It have some basic settings:

Origin offset is point where lower left corner of image will be according to machines' coordinate system.

Pixelsize is size of one pixel of image You can set it as you like, but I think that the best value is 0.1mm or 0.2mm.

Feedrate is speed of laser head in mm/min.

Image horizontal size is output size of engraved image in mm.

Output bitdepth is parameter for calculating steps of PWM. 3 will result 8 colors, 2->4 colors, 1->2 colors meaning only B/W. You shouldn't exceed 8bits, but I suggest to use maximum 4 bits.

App will show you black and white image with reduced bitdepth and after calculation dialog box, that operation was successful.

For better results use some graphic program that will allow you to change image to B/W, make higher contrast and set brightens to appropriate level.

Step 2: Additional Info

imGcode is quite slow when working as standalone, so please be patient. Also it have to install quite big Matlab runtime, which is free to use.

If you have inverted Y axis in opposite direction to my droving in previous step, it will work, but image will be upside down and origin offset will show upper left corner.

Maximal and minimal powers are 255 and 0, others are evenly distributed between max and min. Number of steps is defined by bitdepth 4->16,3->8, 2->4, 1->2 only max and min.

Let me know if any bug appears or you need any changes.



  • Epilog Challenge 9

    Epilog Challenge 9
  • First Time Author Contest 2018

    First Time Author Contest 2018
  • Sew Warm Contest 2018

    Sew Warm Contest 2018

We have a be nice policy.
Please be positive and constructive.



Splash screen comes up, then it disappears ? It is still running in the background tho'


Hey there, downloading as I write. Will it use M106 S commands and can you save in .gcode format. I use it a ramps arduino setup.


Thank you for this. I bought a DIY laser like yours a month of so ago and the software that came with it is very basic and limited. What I want is photos like your example but no luck so far. When I set up a file using Photoshop the laser software takes liberties with it and it turns out most black and white with little to no shading in between. I am getting closer by using "lasergrbl", which is a lot nicer for photos but still tweaking. This laser was so inexpensive so I do not want to buy software that at best will cost $40 or one third the cost of the machine. I tested "T2Laser" and think this might just be the premium photo engraving software but they are cheap with their demo. It only runs for 30 minutes and allows a limit on how many lines it will burn down while testing so not enough time to see results. In a passion, after thinking I was getting good results, I tried to buy the full version of this software but they only accept PayPal, which I have no luck using from where I work near Hong Kong so I was stopped cold. I already could write a book with what I have learned but none of it has yet yielded acceptable results. Now I am starting to consider upgrading to a small Chinese Co2 laser with 40 or 50 watts as they are more versatile in terms of photo burning, especially on acrylic, which our diode lasers will not work very well. It was photos and acrylic that got me interested and these are not working so well with a 6.5 watt diode. I will try your software and let you know how it comopares to what I have tried so far.

Nice work!

Back in the late 80’s I worked in a laser application lab in
Massachusetts. At Christmas time I set up a moving table CO2 laser system to do
a raster scan of black and white artwork.
I set up a bar code reader parallel to the laser head.

I would do a step and repeat raster scan with the table.
When the barcode reader saw dark it would fire the laser. The laser head was
positioned above a piece of birch plywood. It did a very nice job reproducing
the artwork.

Hi, I installed it on my windows 10 desktop and everything went well but when I tried to run the program I got the splash screen and it closed and the another window popped up and immediately closed. So fast I could not see what it was, but it looked like the main window.

You may try using instead of my software. It seems to be good equivalent.

I can assure you they do not work on all systems.

I thank the op for giving us the use of this, it works for me though I am having problems getting small details in faces, any tips for preparing the image first. thanks

You should edit photo first in Lightroom or other developing software. Make it W/B, change contrast to maximum possible, also try using highest values for whites and lowest for blacks, reduce colors to number closest to one you want to achieve (MS paint can save bmps with reduced colors).

Thankyou for that.

With a lot of files I get the message.

MAP must be a mx3array

Error in -> img2gcode02.m at line 12

Can anyone please explain this.


That is some issue with file format. Color map is not recognizable by program. Maybe it shouldn't be BW. I lost code and I don't remember exactly what was there... Try saving it in different format.