Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    The Height Map plugin colormaps are poor.

    Plugins for DWC and DSF
    3
    4
    135
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mjwaters
      mjwaters last edited by

      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:

      1. They don't have very much contrast and have uneven contrast (low perceptual length, non-uniform perceptual derivative)
      2. Are terrible for people with red-green colorblindness, the most common form of colorblindness.
      3. 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

      chrishamm 1 Reply Last reply Reply Quote 1
      • chrishamm
        chrishamm administrators @mjwaters last edited by

        @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.

        Duet software engineer

        o_lampe mjwaters 2 Replies Last reply Reply Quote 0
        • o_lampe
          o_lampe @chrishamm last edited by o_lampe

          @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)

          1 Reply Last reply Reply Quote 0
          • mjwaters
            mjwaters @chrishamm last edited by

            @chrishamm

            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. e31c6cf5-034d-4dc7-8c7c-7ebeedfe5806-image.png

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA