wlenthe / UniformBicone

perceptually uniform colormaps for the unit disk, sphere, and ball
2 stars 2 forks source link

I can't tell how to reproduce all the maps at https://colorcet.com/gallery.html #1

Open sebjameswml opened 1 day ago

sebjameswml commented 1 day ago

Hi William,

Thanks for making your colormap code public. I am currently working to use your code in my OpenGL visualization library morphologica in this issue. I had no trouble accessing the maps that are defined in the code such as 'Fire' and 'Ocean'.

I was guided to your code via the Colorcet gallery. In that gallery there are several colormaps listed with names like CET-L08 (which is similar to your Fire) and CET-L09 (similar to Ocean). However, these precise maps, and some of the others (such as CET-L07, a blue-pink-light pink map) don't appear to be immediately accessible from functions in your header code.

From inspecting the code, I'm imagining that to reproduce, say CET-L07, I simply need to know the several colors which parameterize the spline curve for that map. Can you offer any guidance on how to find out what these colors are?

wlenthe commented 1 day ago

Are you interested in mapping a floating point grayscale value to a floating point RGB triple like the current code does or do you just need 8 bit lookup tables?

If you just need the lookup tables I've added them in the new cet_lut.hpp header.

If you're interesting in a spline representation you could fit some number of control points to an existing LUT, let me know and I'll either mark this as closed or look into it.

sebjameswml commented 1 day ago

I was hoping to be able to define (for example) a new colormap::ramp::cet_l07 function that computes the floating point RGB values in the same way colormap::ramp::ocean does. Seems like ocean does this just with a few colors defined. I think if I were just to select 10 equally spaced colors from the 256 color lookup tables that you committed, I'd be unlikely to get a very good reproduction of the map. Or maybe it would work. What do you think? Can the CET colormaps be expressed as a small handful of parameters like Ocean, Fire etc? If so, who knows/how could one discover the parameters?