更感知统一的颜色图?

More perceptually uniform colormaps?

我提倡在将科学数据绘制为灰度图像并应用假着色时使用感知统一的颜色图。我不知道这些是谁发明的,但这些颜色图太棒了,我不会使用其他任何东西。

老实说,我对许多流行的绘图软件(R-ggplot,python-matplotlib、matlab、JMP 等)。我相信你们中的一些人也有同样的单调感...

那么除了这5张颜色图,还有哪些颜色图在感知上是一致的?

奖励:是否有某种算法可以导出具有感知均匀质量的颜色图(也许不是,因为颜色感知具有心理方面的意义)?但如果是这样,它是什么?

一些示例和参考:

https://www.youtube.com/watch?v=xAoljeRJ3lU

如果您关注此页面:http://bids.github.io/colormap/, you will find all the details required to produce Viridis, Magma, Inferno and Plasma. All the details are too long to enumerate as an answer but using the aforementioned page and viscm,您可以重新生成它们以及一些更具交互性的内容。

或者,使用 Colour:

import colour
import numpy as np

CAM16UCS = colour.convert(['#ff0000', '#00ff00'], 'Hexadecimal', 'CAM16UCS')
gradient = colour.utilities.lerp(
    CAM16UCS[0][np.newaxis],
    CAM16UCS[1][np.newaxis],
    np.linspace(0, 1, 20)[..., np.newaxis])
RGB = colour.convert(gradient, 'CAM16UCS', 'Output-Referred RGB')

colour.plotting.plot_multi_colour_swatches(
    [colour.plotting.ColourSwatch(RGB=np.clip(x, 0, 1)) for x in RGB])

print(colour.convert(RGB, 'Output-Referred RGB', 'Hexadecimal'))

['#fe0000' '#fb3209' '#f74811' '#f35918' '#ef671e' '#ea7423' '#e67f28'
 '#e18a2c' '#dc9430' '#d79e34' '#d1a738' '#cbb03b' '#c4b93d' '#bcc23e'
 '#b2cc3d' '#a6d53a' '#97df36' '#82e92e' '#62f321' '#00ff00']

请注意,两种边界颜色以十六进制值给出,但您显然可以选择任何相关的颜色空间。同样,CAM16 可以换成 JzAzBz 或类似的东西。

您可以使用此在线尝试 Google Colab notebook

我想有点晚了,但是我的 CMasher package 提供了大量(我认为在撰写本文时是 42 个)科学色彩图,这些色彩图在感知上都是连续的。 以下是在撰写本文时 CMasher 中当前可用的所有颜色图的概述。

online documentation中,我分别描述了每个颜色图;讨论改进颜色图使用的主要方法等等。 它还提供了一组实用函数,可用于以各种方式操作颜色图。

要获得具有感知均匀质量的色图,请参考

以下 python 软件包提供(感知上统一的)色图: