Working on a little wysiwyg dither program

Hi Guys and Gals.

I been messing around in Processing (It is a programming language based off Java). I wrote a program that does Floyd–Steinberg dithering which I can confirm matches very closely to the way the GF app dithers. The reason I wrote this is because I want more control over the output. I know @dan stated in a previous post that the GF works best with a non-dithered image, however I have achieved some of my goal. Here are some screenshots.

To match the GF application was not my goal, my goal is to get what I see on my preview to look exactly the same in the GF application, this way I can tell exactly what will be burned. While I am all for the simple modes of just upload and it looks good, there are times you want control.

So what control does my application offer. Well you can set to the amount of grey scale you would like, from 1 bit (true black and white) to 256 levels. However anything over 4 color and it appears the GF app changes the dither pattern, to be expected as it appears to bring any image down to a 4 color dither.

Here is a black and white from my app and a small mp4 (please ignore the compression artifacts) to show how I can adjust the white point / black point and brightness. I am working on adding a white/black biased gamma curve :
p18-55-45_3

My question for Dan and the GF team is: Can we get, or is it planned to offer a true black and white bitmapped mode where the GF app does not re-dither the image? I realize that this would mean you would not and should not be able to resize your image smaller past 1:1 ratio since anything smaller would mean removing pixels and therefore adjusting the density.

Second question for the community is am I alone in wanting this ? Also if there is enough interest I could upload this app somewhere.

Thanks for your consideration

-Greg

6 Likes

Isn’t this what vary power is? I’d think that if you took your dithered output, ensured that it was black and white, no greys, imported to the UI as a raster, then set it as vary power at a high enough LPI*, you’d get what you’re asking.

I assume you tried this already?

Also your original question for @dan is a good one but GF staff doesn’t actively monitor any categories other than problems and support. I’ve tagged dan here but that’s no guarantee — he’s a busy guy. If you need an answer more quickly I’d recommend emailing support or asking in a new thread in P&S.

* What is “high enough” LPI will depend on the resolution of your source image and the desired size of your output — and to a lesser extent the material you’re using. Lots of discussion about this if you go looking on the forum, but I generally just go with 270+ and get very good results. Engraving is complex, there are lots of trade offs with various settings, you’ll have to experiment a bit.

6 Likes

Oh hey also, you might be interested in this thread I posted ages ago about really tweaking the way engraving works.

Given your skills in processing, I bet you could make some really interesting stuff doing something like this. I’ve only fooled around with processing enough to be dangerous… but if you get into really tweaking images and then output SVG or possibly output raster and combine them with the trace functions of Inkscape et al, you’ll probably invent a ton of new ideas.

Also also, WAAAY previously, there was some discussion about when GF changed the duthering engine. It sounds like you know your Floyds from your Steinbergs, so you might want to look around there if you haven’t.

https://community.glowforge.com/search?q=steinberg

and dithering in general:

https://community.glowforge.com/search?q=dithering%20order%3Alatest

2 Likes

I have not. I will try that… as well as read your previous post ! Thanks!

1 Like

Little bit of an update, I played with varied power a bit and also did some calculations. Its stated that the lasers kerf is 8 thou or 0.2032mm which would come out to 125 of them inside of an inch (1"/.008 = 125). So what I am trying to figure out is if that is the smallest dot I can make inside of a pattern. I know the machine can register 1 thou or .0254mm. It is important to understand the difference between registration and smallest dot/kerf. All that said I am still seeking proper settings to be able to produce the smallest checkerboard pattern that I can. :slight_smile: any help or tutelage would be appreciated.

-Greg

Kerf varies with material and kerf isn’t necessarily spot size.

2 Likes

This is a good question, and there’s not one exact answer. Fundamentally you’re limited by the a combination of size of the laser beam on the material (which is greatly influenced by how accurate your material height setting is), your power and speed parameters, and some properties of the material itself.

It gets complicated quickly, and you’ll probably drive yourself nuts trying to find “the” answer. You’ll probably be better off finding out what works reliably, and not trying to get to the absolute limit.

Add in that focus is driven mechanically and goes in steps, if you’re looking for the absolute smallest spot.

Thanks for the replies, yes I knew that, sort of… I knew it was an average. I also know it depends on the focus height. Due to the fact that the application knows when to redither the image I assumed there was an absolute limit, meaning best focus spot on dot. I also know the LPI is tied to the y gantry but the dots across the x are determined by the speed / power. Its a tricky one and I will keep testing when I have time. How cool would it be to know before hand what the product will more or less look like before uploading it to the app. That is what I am after in the end :smiley:

Again thanks for your time and attention on this :slight_smile:

Well… what it will “look like” will depend on a lot of factors too.

Take intended application/installation, for example. What viewing distance are you talking about? In reality, anything approaching 200 dpi is going to be pretty smooth from any reasonable viewing distance, and 300 would be really good up close. Take laser print for example, it’s usually 300 dpi. If you want tighter than that, you might be able to get it, but a dithered image with dot pitch in the 1/300th range will probably get you really good results and should be pretty attainable with the GF.

Given that the GF has a nice 270 lpi setting, I would say that that’s a good target resolution for ease of setup.

Your results will depend on so much, you’re just going to have to test and get a feel for what works for your specific scenario, the materials, settings, art, and intended use all add up to some unique set of constraints and requirements on your end. In the end if you think it looks good at whatever settings you have chosen, that’s probably all you need to know.

In a way, it’s a bit like darkroom photography. You never know for sure how it’s going to come out until you’ve applied the fixer. You can get pretty close but there’s some analog-ness that you just can’t get away from with lasers.

You started by wanting to know “more or less” what it will look like before sending… some experience with engraving will give you that. I know more or less how a job will look before I put laser to material, but that’s because I’ve done a bunch of engraves and know my materials. Go forth and ruin some things! It’s fun and you learn a lot, quickly.

2 Likes

By look like I meant knowing the dot pattern configuration, not necessarily exactly how it would look. What I am trying to nail down is how something more or less will pattern out on the piece. Right now the process is , adjust a greyscale image in an image program. Export that as a PNG , BMP or JPG etc. Load it into GF and size it… look at the dot pattern GF gives you, something looks dark? need to adjust, back to step one before burning it. <-- thats the main part I am trying to improve :smiley:

What I am trying to do is get a good result that I can load into the app so I don’t need to keep exporting / loading… ad nauseam. For that I wanted to know the limits of the application, then if Perhaps I am not conveying it properly. My apologies.

I’m still thinking it would be awesome if someone much smarter and more capable than me could develop an ICC-type profile for various (or any!) materials, using Proofgrade settings. How cool would it be to just load the ICC profile and edit to that?

3 Likes

Update: I added the ability to export the image as an SVG !!!

The first version of the export was pretty bad as I was just taking the pixel value and creating a square vector for it and then slapping it in a grid. This would produce an accurate SVG file however black pixels next to each other would each be a filled path and have 4 points. This lead to files with 90K paths and a couple hundred thousand points. The GF would choke on them for a while then spit out an error.

I then found a really good library that allowed me to make unions from the little squares that merged them together ! YAY! except that the way I was building the squares and adding them one by one caused it to take like 10 minutes to complete a photo. Then I had a bright idea of creating two polygon objects, one for the X row that would be added to Y and then thrown out every time a row was done. Boom! 20 seconds :slight_smile:

GF loads the new merged files without a problem as the test photo used above went from 90K paths to just over 3K, and of course the number of points is drastically reduced as well.

So far the SVG is only outputting black and white, I need to re-write the function to handle 3 or more shades… that shouldn’t be too hard at this point though.

Lastly I added the much needed Gamma function after a quick search online (because I am not that great at math LOL) It turned out to just be calculating the gamma correction from gamma (1.0 is no gamma) by dividing 1 by the gamma you want, then raising the current brightness value to the power of the correction… something like this:

  float gammaCorrection = 1 / igamma;
  b = pow(b, gammaCorrection );

I’ve already run a couple successful engraves in MDF. I’ve not played around with score or cut yet though :slight_smile:

Oh yeah and I also added in a really easy invert function… because you never know when you want that image to be negative.

I’m tired now and at the end of my day (I work nights) I will update this again with some nice photos and maybe make a youtube video showing this all off this weekend.

-Greg

2 Likes

This topic was automatically closed 32 days after the last reply. New replies are no longer allowed.