{"id":159,"date":"2024-07-24T10:49:32","date_gmt":"2024-07-24T10:49:32","guid":{"rendered":"http:\/\/bentus\/?p=159"},"modified":"2024-07-24T11:19:18","modified_gmt":"2024-07-24T11:19:18","slug":"multivariate-colormaps-for-n-dimensions","status":"publish","type":"post","link":"http:\/\/bentus\/multivariate-colormaps-for-n-dimensions\/","title":{"rendered":"Multivariate colormaps for n dimensions"},"content":{"rendered":"\n

Much work has been done in the last decade related to 1-dimensional colormaps (see for eaxmple Peter Kovesis paper<\/a> and Nathaniel Smith and St\u00e9fan van der Walts talk<\/a> (2015)).<\/p>\n\n\n\n

This post follows my previous post on 2D colormaps<\/a>, and many of the design principles will be the same. However, with n \u2265 3, it quickly becomes unfeasible to create a full lookup table. With n = 3 channels and 256 values in each channel, the lookup table would be a matrix of 256^3 elements, likely much larger than the image the colormap is applied to. Instead, n independent 1D lookup tables are created, and the resulting colors are then combined.<\/p>\n\n\n\n\n\n\n\n

The simplest approach is to assign one color channel (R, G, B) to each channel in the image; in the below image the same data is shown mapped to (R, G, B) and (G, B, R): [data source]<\/a><\/p>\n\n\n

\n
\"\"<\/figure><\/div>\n\n\n

Both images above display the same data, with the same normalization, but by swapping the color different aspects are highlighted. The green channel has higher perceptual lightness and saturation, and the features of the green channel are therefore highlighted.
The lightness and saturation of the R, G and B channels can be visualized by displaying the three channels in a perceptually uniform colorspace. <\/p>\n\n\n\n