Image2Gcode - Free Raster Image Laser Engraving Software - Modified for MPCNC

Bryan,

Man I cant wait for diagnal to be added to the newest version, for example in this acrylic job which I created in image2gcod v4, there was so much space in image that was not lasered at all due to white background after I removed original background in inkscape to seperate it from the image I wanted. Trace bitmap multi scan tool, so freaking awesome lol. Your program works so awesome man, seriously crazy sick man. I wonder a couple things though again knowing nothing of code writing lol. It possible to perhaps create a few general shapes that could be used to size around an image such as this one I attached in order to cut project out after print is done? Another question is could you possibly allow for dither to spread from 1 to say 5? I did check my marlin code as well as included it in a post last week and could not find where my feed rates were maxed out. I can only attach images here where others are able to include embedded in their post. Also tested on glass, tile, and metal but found that most use a laser marking material called ceremark, which creates like a printed ink design with no etching.

Bryan,

Man I cant wait for diagonal to be added to the newest version, for example in this acrylic job which I created in image2gcod v4, there was so much space in image that was not lasered at all due to white background after I removed original background in inkscape to separate it from the image I wanted. Trace bitmap multi scan tool, so freaking awesome lol. Your program works so awesome man, seriously crazy sick man. I wonder a couple things though again knowing nothing of code writing lol. It possible to perhaps create a few general shapes that could be used to size around an image such as this one I attached in order to cut project out after print is done? Another question is could you possibly allow for dither to spread from 1 to say 5? I did check my marlin code as well as included it in a post last week and could not find where my feed rates were maxed out. I can only attach images here where others are able to include embedded in their post. Also tested on glass, tile, and metal but found that most use a laser marking material called ceremark, which creates like a printed ink design with no etching.

Andrew,

Great work! I really like what you’ve done. At some point, I would like to add vector engraving to the tool. With that, you could easily do what you want.
I can look into varying the dithering setting too.

Are you referring to line after line of simple G1 Y moves with nothing in between? I am aware of that, and I haven’t had the time lately to fix it.

Filesize increases exponentially with increasing resolution. So it’s to be expected.

-It has already been determined by Leo69 and others that the M106 command has to be on its own line.

“The current way of generating the G1 moves blows the files up too much.
As long as there is no change in power all G1 commands before the last can be deleted to create a single line instead of dots.
Currently I have to set the resolution to 0.2 and the image DPI to 100 to be able to engrave a 23x17cm image, would be great to try that again in a much finer resolution ?”
– Can you provide an example of the moves that aren’t needed?

Man your my new hero lol, the wood engravings I have done also turn out awesome again all done with v4 of image2gcode, the image in acrylic was done at level 63 max 0 min feed 5000, which I can adjust on the fly via turn knob to faster or slower feed rates. At max 63 my amp meter on laser doesnt make it to mid point, which means the laser would burn at twice that value to hit 100% max laser power. which explains allot if you think about it because at 255 or normal max output for most in this group, I would be 125 or so above my max.

This image took about an our since it had to scan/print even the areas that were white in the image at 100mm by 100mm So when ever the diagonal option comes back into play in the new version of software I will be all over it lol to cut that time in half. There is so much that goes into getting an image ready to print and that is with using a tool that does the majority of the hard stuff for us, cant image what it is like to create a software to do the work like what you have done with image2gcode, absolutely amazes me. Thank you again for all your efforts man, have I asked you before if you have a donate page? to help further the process of development from folks like myself?

Feel free to spread the word about it. However, I do have some reservations about opening up support to everyone. I’ve been helping out you K40 guys out of the generosity of my heart :wink: and in the hopes that one day I may have my own and make use of it. However, my priorities are with the MPCNC based setup that most of us on this board that have lasers are running.

Will try to get some small sample together so you see what I mean.
As a sidenote: What would be all needed to compile the program myself from sources?
If I find the time on weekend I might try to fiddle around with the code a bit myself.
Give me a few hours and will upload a Rar archive somewhere with the code examples and some explanations.

Great!
It seems this forum is nice enough to allow the upload directly, so here it goes :wink:

Code-example-and-explanation.rar (110 KB)

Bryan-

I sent you a PM here a while back and not certain you got it? Either way this topic has not had any new posts in some time now, like everything else in this arena everything is changing at such a crazy pace newer, bigger, better lol. I am hoping you have made some progress in the vector abilities of image2gcode as well as the ability to cut diagonally. For whatever reason the diagonal cutting seems more proportionate than the horizontal cuts, even if my slide bearings were 100%, Id still prefer diagonal cuts. Let me know if there is anything I can do to help you in the progress.

Regards
Andrew

Andrew,
I saw your message and responded to it over 5 days ago. As I said in the message, I have been quite busy using my CNC to make things for craft fairs and I haven’t been able to mess with this much at all. As for right now, vector capabilities is a low priority because it’s a pretty big addition and I am currently using inkscape for that.

What do you mean “diagonal cutting seems more proportionate than the horizontal cuts”?

Noname007,
Are you sure that you checked the box “Optimized Raster (Horizontal Only)” ?
I loaded the image that you supplied and checked that box and it does not have any extraneous G1 commands.

If you download the entire source code from the github link, you can open the project in visual studios. I have been doing revisions with that (it is written in C#)

Bryan,

All good man and sorry for the bother. I am not sure where I would check to see a response to pm lol so I must have missed it. I can understand the vector aspect being a huge add and like you I use inkscape, although I am not very good at it yet lol. In fact I just got raster capabilities to work after six months of coding issues with my firmware on laser as well as software used for inskape exporter plugin. I ended up having to do cmd install on both then had to modify my firmware to accept raster code from plugin all which I know nothing about lol.

About the horizontal and diagonal cutting, I have not taken exact measurements however the difference are seen in the items I produced. The horizontal items when set beside diagonal seem shorter/wider while diagonal cuts more inline with set sizes in image2gcode. When printing or cutting in either horizontal or diagonal I thought the image would be the same? Regardless the end result with diagonal cut/print seem more in line with measurements in code. Tried to attach two images but they are to big, I will do some measurements when I get time. I just need to get busy and pull the gantry apart again to replace the slide bearings for y axis then I can print horizontal again without catching. Can you suggest a good cnc machine to start with that could also be used for 3d printing?

I used the optimized raster later on when realising that it not only affects the white areas of the image.
So that problem was solved with some logic that I should have applied sooner :wink:
Anyways, I modified the source code a bit so it is directly suited for the Turnkey Tyranny firmware.
All unwanted code was removed like the box around the engraving.
By the way the weird coordinates with no decimal seperator seem to be related to the locale settings.
No matter what I tried I either got a comma or nothing at all to seperate.
As I don’t really need that move I commented it out as well.
So all I need to change is the G92 offset in the header to get what I want and where I want it.

Found a workaround for totally black areas not being engraved as well:
Within Image2Gcode increase the brightness by 10% and reduce the contrast by 10% - now all shades will be interpolated correctly.
So far I was unable to locate the source of the problem but the workaround works :wink:

Here is the top of a Gcode file with these changes:

;(Generated by 3dpBurner Image2Gcode v1.0)
;(@Mrz.13.2016 20:37:00)
M05

G92 X-135 Y-50
G90

G21

G1 F6000

M03 S0
G1 X0 S0
G1 Y49.92
G1 X0.12 S896
G1 X0.24 S890
G1 X0.48 S888
G1 X0.6 S886
G1 X0.72 S889
G1 X0.84 S895
G1 X0.96 S899
G1 X1.08 S904
G1 X1.2 S907

If anyone with a CO2 Laser wants to try it, there is a temp version of the program uploaded here.
Still trying some changes but if anyone needs the source files then I will upload them as well.

Tested Miss Monroe in 65mm wide with a resolution of 0.1 and the engraving took just 35min.
Still some pinholes here and there, so next step is to play with the firmware and buffers to eliminate those.
Might just need some changes in regards to prefering the G1 commands for the look ahead planner.
Once you started with real 8bit engravings you wonder why you ever bothered with raster engravings, although I have to say they work better on glass.
Thanks again guys for making this possible!

Here is Miss M. engraved on a sheet of copy paper:


Sure, printing her would be faster and maybe in better quality but I wanted to see if I can tune the laser to do it without buring through the paper.
Except for a few pinholes it went quite well, time was 26 minutes for the 65mm wide image at 0.10 resolution.

im having the same problem with this software as I do with piclaser. Anything more than 200mm/m or so and my cnc shakes and stutters down the line . of course this doesnt happen in laseretch, or moving 5000mm/m in any other software… for some reason, its these image softwares that screw me up

@Ryan can you post a bit of gcode from laseretch and image2gcode for comparison? Laseretch doesn’t do Grayscale so the files are probably much lighter. Are you running gcode off sdcard? If not then which host software? What speed are your serial coms at? All are factors that may contribute

Maybe I can shed some light into this…
The way the code is generated is quite intense, but there is no way to avoid massive Gcode files if you want good quality 8bit engravings.
Then there is the way the controller/firmware works.
Usually they try to “look ahead” to get some movements stored for smooth operation.
This sadly fails in standard configurations as we simply have too many lines of code that constantly change.
The main issue however is speed - not the speed of motors but the speed of your connection.
Keep in mind that the next command needs to be available for processing before the current move is over.
It is not like cutting a 100mm line with fixed settings and a fixed speed - in these 100mm you can have more than 100 single commands…
When it comes to Arduino’s or similar processors you need to consider the serial com chip and the CPU speed as well.
57600baud is about the max the Mega can handle before something get’s dropped or mangled up.
A reliable speed on my machine for 0.10 resolution is 850mm/min - anything above and the machine runs into troubles.
Can do 2400mm/min if I really want to but than there is banging, pinholes and so on.
Still working on utilising the bigger memory of the Mega to store commands and serial communication.

Edit: Increasing the buffer to 256 fixes some of the issues and the movement is smoother but still not perfect.
From the SD it works a tiny bit better and filesize is no issue either, unlike with Pronterface always complaining.
Not sure when I find some time to dissect Marlin again and if I can make some changes to the look ahead buffer there…

Okay, I can’t believe how sharp you guys are. So this sounds like if we drop back down to 16th stepping we would cut the commands transferred in half correct? Smoother laser etching? Easy fix, remove a few jumpers and flash a new firmware? This also might help because most kits are sold with the large lcd, resource hog?

If you wanna toss me a new firmware, and let me know which jumpers to remove (im guessing just the one thats on the X and Y steppers) ill try it out