GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
263 stars 53 forks source link

Additional color palettes? #268

Closed tzanio closed 1 week ago

tzanio commented 10 months ago

Consider adding support for additional color palettes such as the colour-vision deficiency friendly and perceptually-uniform colour maps at https://zenodo.org/records/8409685

+ScientificColourMaps8-FabioCrameri

See also https://github.com/GLVis/glvis/tree/colormap_dev

justinlaughlin commented 9 months ago

I can work on this.

justinlaughlin commented 9 months ago

I think I've tried every one of the colormaps from Fabio Crameri in grad school :'). A couple quick thoughts... colormap designers often emphasize linear luminosity (one of the main criticisms of jet is that its luminosity is nonlinear and non-monotonic) which is a feature that makes perfect sense for 2d data. However in 3d it can start to lose significance because there is almost always some kind of lighting applied to the scene. It is still a good thing to have, but IMO span of luminosity+color is more important in a scene with lighting. I like batlow and lipari from this set, as they are perceptually uniform, span many colors, and look good. I'm not a huge fan of colormaps like buda and nuuk as their range of color/luminosity is small, so scene lighting will more dramatically influence perception.

Lmk if you have any thoughts on which colormaps we should add.

tzanio commented 9 months ago

I'm also wondering if we need more colormaps, but if we decide to add them, I do like batlow and lipari myself.

We already have some perceptually uniform maps in https://github.com/GLVis/glvis/blob/master/lib/palettes.cpp from https://github.com/1313e/CMasher and https://bids.github.io/colormap/.

justinlaughlin commented 9 months ago

If there is too many options we might need a different interface to choose a colormap besides "cycling". Maybe the most common colormaps can be cycled through, and for those who want more options, a separate hotkey could let you input a name to a specific colormap. That way we could add in as many colormaps as we want without cluttering the colormap cycle.

tzanio commented 9 months ago

You can always "jump" to a particular color palette with F6, but I agree that cycling through a lot of palettes has its downsides.

Another option could be to enable extra palettes with a build options.

tzanio commented 1 week ago

Addressed in https://github.com/GLVis/glvis/pull/289