Introduction: Grbl Gcode Laser Engraving With Software

Picture of 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

Picture of 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.


PaulS615 (author)2017-06-07

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.

Vidmo (author)2017-03-31

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

PicengraverToo (author)2016-06-18

You did not look far enough for image to gcode software to laser engrave photos.

Photo engraving examples done with a varied intensity controlled 445nm laser diode.

erniehatt (author)PicengraverToo2017-03-03

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

Vidmo (author)erniehatt2017-03-03

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).

erniehatt (author)Vidmo2017-03-03

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.


Vidmo (author)erniehatt2017-03-04

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.

Vidmo (author)PicengraverToo2016-06-19

It is too expensive for me. I would have to work longer to earn $40 than I coded my application.

adibiut (author)2017-02-07

Hi. Do you have version for 32bit cpu?

This doesn't run on my laptop

Vidmo (author)adibiut2017-02-07

I'll see what I can do.

Vidmo (author)Vidmo2017-02-24

I'm sorry, I can't find code anywhere, I think it's on my old PC in myparents' house. Unfortunetly it might be corrupted, because I had very unplesant virus on that pc. I'll let you know as soon as I visit my parents.

anfedi (author)2016-07-31

hola,en windows no me deja abrir el progama

flashsolutions (author)2016-07-05

Very nice! Thanks for sharing. I have been looking for an inexpensive way to experiment with this capability.