The Height Map plugin colormaps are poor.
-
I wouldn't complain about this normally, but I greatly appreciate DuetWebControl and this is how I can give back.
The colormaps for height, Terrain and Heat, in the plugin are poor because:
- They don't have very much contrast and have uneven contrast (low perceptual length, non-uniform perceptual derivative)
- Are terrible for people with red-green colorblindness, the most common form of colorblindness.
- A diverging colormap would be better for a variable that deviates around a mean.
More info:
Matplotlib guide to colormaps: https://matplotlib.org/stable/tutorials/colors/colormaps.html
A talk by MPL: https://www.youtube.com/watch?v=xAoljeRJ3lU
A paper: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8309845/An easy solution would be to ask MPL if we can copy some of their colormaps. Alternatively, I can design some new ones specifically for the plugin.
Cheers,
-Mike -
@mjwaters Thanks for mentioning this. I'm open to adding new color palettes but you'd have to propose some then.
Ideally you could try them out and send me a PR via GitHub. Currently, the heightmap colors are computed here: https://github.com/Duet3D/DuetWebControl/blob/master/src/plugins/HeightMap/3dbjs.js#L234
Alternatively, please propose some color palettes, ranges, and suitable names here.
-
@chrishamm
I'd propose a greyscale palette, either with fixed ratio (eg. above 0.2mm = white/ below -0.2mm = black) or adapted ratio (currently highest point is white, lowest is black) -
Hi Chris, I'm going to be slow to respond with how busy work is for the next two months. But don't worry, I'm committed. My github name is mikejwaters.
How hard would it be to implement a function that interpolates the RGB value from a look up table of colors? In the future, users could upload their own 'custom_colormap.csv' maybe? I'm brainstorming, but I must admit I'm not much of a JS programmer. Mostly Python for me.
Stylistically, I think a diverging colormaps make the most sense since we think of the bed plane as a reference level that we deviate from.
Here's an example that should be great for colorblindness.