Grey scale height map format test

A quick experiment on different graphic formats. Projected the same geometry as a grey scale height map and then saved as different image formats: compressed and uncompressed PNG; compressed and uncompressed JPG; and compressed and uncompressed Tiff.

These are the results you get from them without any clean up and same setup parameters

Always a balance of file size versus pattern quality.


I don’t think those would realize the 3D model which you expect.

What does the original 3D model look like?

Why make a pixel image at all? Why not feed the 3D data into Kiri:Moto or some other 3D CAM tool?

Grey scale height map images are just another format for cnc patterns. The pixel location is the x,y coordinates and the grey scale color is the z coordinate.

The image tests above are the geometry I got from the same image using different formats showing the impact of using different image types.

The pattern is this:

Using different software you can create an STL from it for porting to gcode.

This is a format I use to share some of the patterns I make but was unaware on how huge of an impact using the wrong format makes. The reason for using this format is varied, such as reduced file size vs STL or conversion of 3d to 2.5d.


That looks a bit more like what I was expecting.

I’d avoid any sort of compression or file format which will change any of the greyscale values.

1 Like


I was unaware certain sites had started compressing their images. They didn’t before but I am assuming hosting costs were getting higher.

Reprocessing the files also helps strip out the occasional embedded malware (:frowning:) and private metadata. It can also make a site faster to display, and for normal images you can often get substantial improvement without visible artifacts. So there are plenty of reasons reprocess files by default besides cost…

It might be interesting to compare originals to processed versions — I think that loading them as two layers in, say, GIMP, and then using one as a subtractive filter for the other, then applying a gamma adjustment, should highlight differences at a pixel level. :thinking:


Good to know. Thank you.

Not an issue. I am just trying to understand my own ignorance since I did not consider the impact to my patterns when sharing in this format on certain sites.

These were uploaded with the same image pattern and what different site formats/compression does to the pattern.

The first image was posted on Pinterest. My worst hit because I have been posting for years on there and have over a 100 patterns on there. My understanding now is they started doing this about 2 years ago. I am late to the party.

The second image is from a cnc forum site that I post frequently to. They recently went to a web format of avif. Looks great on screen but destroys the quality.

The third image is from another cnc forum site that does not compress the image but limits the upload file size.That is the way the pattern should look like but the site requires membership and uses a proprietary cnc format so not a lot of users.

So just have to figure out where I want to host my image patterns that is easiest for myself.

1 Like

And if anyone is curious, this is what this site’s version looks like. Actually not too bad. A simple blur prior to porting to gcode will take care of a lot of the pixelation. Pattern was shared under Halloween Pumpkin box thread.

1 Like

I assume that last picture is “as carved”? I mean, it’s not what I see when looking at the images.

I just found some settings:

You don’t want to use JPEG for height maps because it’s lossy compression. PNG is lossless.

So I just changed png_to_jpg_quality to 100:

I think that if you now upload PNG files for height maps, they won’t suffer this problem at all.

1 Like

Awesome! Thank you. The last image was the conversion of the image to geometry for STL export after the site compression. A simple fix was just to add a blur on the image or a smooth modifier in Blender.

1 Like