Skip to content

Bad colormaps #122

@kryptan

Description

@kryptan

Colormaps are defined in src/backend/cmap.hpp in sRGB colorspace.

  1. Default (gray) colormap is defined by linearly increasing gray values. This linear increase happens in the sRGB colorspace. One should probably use linearly increasing values in a perceptually uniform colorspace so that e.g. 0.8 is perceptually 2x brighter than 0.4. For gray values sRGB is close so it is not a big deal but something better should probably be used.

  2. Spectrum. Its name suggests that it represents spectral colors. However pure spectral colors lie outside of the sRGB colorspace (as can be seen from the CIE chromaticity diagram for sRGB) and thus cannot be displayed on most modern monitors. The best thing we can do here is probably to take some interval, e.g. 400nm - 700nm, so that value 0.0 will correspondent to 400nm, 1.0 to 700nm and calculate sRGB colors closest to the spectral ones on this interval. I have not done this but I think that currently specified colormap is nowhere near it (maybe it is, but it must be verified).

  3. Colors. Comment says "pure colors" without any clarification of what does it mean. This colormap has different flaws. First of all it is not perceptually uniform, there are almost flat areas interleaved with abrupt changes. Also it contains colors of different brightness even though it looks like it was meant not to.

  4. Red. This looks legit.

  5. Mood. This looks legit.

  6. Heat. It is defined only by 64 points and there is no interpolation between them, this results in a very noticeable banding. It is also highly perceptually non-uniform.
    heat

  7. Blue. There is an abrupt change in this one near 200.
    blue

I suggest to add colormaps designed for matplotlib and remove of fix others.

It is important to have good colormaps, e.g. when bad colormaps are used in medicine they can lead to misdiagnosis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions