I just started using LB since I switched from Mach4 control to Centroid, so LB can generate compatible Gcode for me
So far I really like LB, however there is one thing I haven’t been able to figure out. It seems that all of the Image Mode types do some kind of sampling of the .bmp, instead of preserving the original array. I want to be able to print out the exact pixel data (i’m using these for laser calibration and testing), but be able to change the DPI value. This is an easy thing to do in other software (like ImagR, gimp, paint.net), but I can’t figure out how to do it in LB.
However, in LB, the only way I seem to be able to create a Gcode file that burns the exact pixel array is to use passthrough, which disables the DPI adjustment setting.
Yes, in the cut settings editor. If I select passthrough mode, then it disables the DPI adjustment. If I turn passthrough off so that I can set DPI, then every mode seems to muck with the .bmp image. I don’t want it to be resampled and adjusted, but I can’t figure out how to do that.
Not positive, but if you use Greyscale with zero image corrections, that might give you what you want.
Please remember your DPI cannot exceed the capability of your laser for increased resolution. Higher than what your laser can do simply means you are double-burning the image.
I know nothing about your laser module, so I cannot make any recommendations.
I thought greyscale would do it too, but greyscale tries to do gradual shading on each pixel, even though the original pixel coloring is black. Threshold mode maintains the correct shade, but does not reproduce the bitmap correctly.
I am honestly unsure what you expect in the output, so I have no solution. The only thing I can suggest is to set the DPI in the image before importing and use the pass-thru mode.
Well, I was hoping there was a way to scale the DPI value of the imported BMP before generating the Gcode, so I don’t have to go back and generate a bunch of different resolution images in another program. This would be very easy to do, so I was assuming it had the capability. It would be much easier/faster to do this in LB since you can make changes and regenerate the Gcode very quickly that way.
No, in ImagR you can load in a BMP, and change the DPI setting and re-save as a BMP and it have have the exact same data array, just a different DPI setting in the header.
By definition, Passthrough mode delivers the image pixels directly to the laser, spaced according to the Scan Interval setting for that layer on both the X and Y axes.
When working with images that have been pre-processed for laser engraving, enable this setting to engrave the image as-is, rather than resampling using the Image Modes described below. Line Interval/DPI will be directly tied to the size of the image.
Which means the physical size of the image burned into the material depends on:
The number of pixels in the image rows / columns
The LightBurn Interval setting
Not the DPI of the image
Once you set the layer’s line spacing, then you must build the image pixel-by-pixel to deliver the exact size you want.
I used GIMP for the grayscale bars and drew the blocks in LightBurn, but both depend on pixel-by pixel control of the output based on knowing the layer DPI.
I agree, passthrough shouldn’t modify the image. I think my question was too heavily weighted towards how to change the resolution with passthrough (which I agree violates the whole concept of passthrough). It should have been more like "how can I import a bmp and change the resolution (i.e. not in passthrough mode) and create a gcode file that will preserve the integrity of the bitmap. As you show above, that can be done in the image itself with an image editor (I have been doing it with ImagR as well) before loading the image into LB.
I was hoping there was a mode in the Cut Settings editor that would do that. I understand that applying a dithering algorythm would change up the pixels, but i don’t want to apply an image algorythm, I just want to apply a different dpi setting to the same pixel array. I thought grayscale would do that, but for some reason that adds shading to my image, even through what I loaded was only black and white. It seems to chop up the pixels into peices of different shades of grey. I just want it to burn at max and min power like the original image was defined.
Passthrough mode only cares about the number of pixels and ignores the image DPI. Selecting that mode means you insist each pixel land on the grid spaced at the LightBurn line interval.
For all other image modes, LightBurn resamples the incoming image to create pixels on the line interval grid. For Grayscale mode, that means it must interpolate between adjacent pixel values to create new ones.
For example, if the incoming image is at 127 DPI and the line interval is 254 DPI, LightBurn must come up with a new pixel between each pair of image pixels. When two adjacent pixels are black and white, the new pixel will be gray. At 518 DPI, the three new pixels will be various shades of gray.
Grayscale sends those pixels out, while the dithering modes apply another resampling to produce the dot pattern corresponding to the pixel values.
When you insist on an exact pixel value for each pixel, you must use Passthrough mode and create a suitable pixel array matching whatever line interval you use.
Well, that just gave me a clue why it works differently than what I can do in ImagR. ImagR allows you to choose the size of the image in length or in pixels. If you choose pixels and a different DPI, it just shrinks the pixel size, and therefore size of the image. LB only lets you resize based on length, so changing the pixel size requires adding/removing pixels.
That makes me wonder if I also scale the image size by the same percentage as I’m changing the line interval, would LB then be able to reproduce the same pixel array? I’ll try that (unless you already know the answer?).
Thanks for helping me on this by the way.
When you say “tell lightburn the interval”, you mean the DPI number thats in the image file itself, right? Or are you saying there is actually a way to tell LB to use a different interval than what is embeded in the image? When I use passthrough, all the interval settings that I see grey out and aren’t editable.
Gotta eat my words. I was thinking Grayscale and typing Passthrough. The trouble with powerful medications is the part of you in charge of noticing errors is the first part to go AWOL; that’s my story and I’m sticking with it.
Perhaps I can get this right, with the understanding that Line interval is the reciprocal of the DPI with an appropriate unit change.
Passthrough and Grayscale do the same thing when the image DPI matches the LightBurn Line interval: the pixels sluice through to the laser without change. In both cases, the engraved pixels will be spaced apart as determined by the DPI = Line interval.
Grayscale allows you to change the engraved pixel spacing by setting the Line interval to a different value than the image DPI. However, LightBurn must resample the image to generate (or remove) pixels at the Line interval spacing by interpolating between the image pixel values at their DPI.
That process will fill the new (to-be-engraved) pixels between two old (image) pixels with interpolated grayscale values, which makes sense when the image is a picture: you generally want smooth transitions rather than blocky chunks. The black-and-white test patterns you and I use will develop fuzzy gray edges, which is not what we want.
The only way around that is to not allow LightBurn to do the resampling, by building a black-and-white image with the DPI matching the eventual Line interval. That image could sluice directly through in Passthrough or in Grayscale mode at the same DPI.
Which means producing an engraving with a given physical size requires building an image with the proper number of pixels at the corresponding DPI: change the DPI and the number of pixels much change.
A raster image editor (GIMP, etc) can resize images using other interpolation methods for the new pixels. GIMP has a None interpolation duplicating the nearest neighboring pixel’s color after the resampling: it won’t introduce gray values, but you and I may not agree with its choice of neighbor.
If you want a precise black-and-white engraving, the image must have exactly the right pixels at exactly the right DPI to eliminate the need for resampling.