Readit News logoReadit News
splittingTimes · 3 years ago
> rainbow palette for use in my data visualisations.

Indeed for her kind of data the rainbow palette works okay. But if you have to visualize more complex / denser data, beware of the pitfalls of the rainbow color palette. It is not always the best choice.

IBM did research back in the 90s on perceptually-based colormaps and how to best represent various types of data within the color dimensions of luminescence, saturation and hue [1]. For example, they found that,

(1) Hue was not a good dimension for encoding magnitude information, i.e. rainbow color maps are bad.

(2) The mechanisms in human vision responsible for high spatial frequency information processing are luminance channels. If the data to be represented have high spatial frequency, use a color map which has a strong luminance variation across the data range.

(3) For interval and ratio data, both luminance- and saturation-varying color maps should produce the effect of having equal steps in data value correspond to equal perceptual steps, but the first will be most effective for high spatial frequency data variations and the second will be most effective for low spatial frequency variations.

===

[1] the original link got removed from IBMs website. Back in the day it was under

https://www.research.ibm.com/people/l/lloydt/color/color.HTM

A pdf copy is here:

https://github.com/frankMilde/interesting-reads/blob/master/...

nerdponx · 3 years ago
A whole lot of work has been done more recently on "perceptually uniform" color palettes. See the Brewer color palette family, the "scientific colourmaps" by Crameri, and the Viridis color palette family, the latter of which was famously adopted by Matplotlib several years ago.
p-e-w · 3 years ago
Note that most modern palettes are designed with various forms of color blindness in mind. For that purpose, they artificially restrict the range of colors, which in turn reduces the visual information they can carry for the vast majority of people who have normal color vision.

I'd be super interested to see a study that examines how color blindness-aware design affects people without color blindness. Such design often completely avoids red hues, which are of huge importance as visual cues to normally sighted people. It's hard to imagine this doesn't have a negative impact somehow, yet I've never seen this discussed anywhere.

maliker · 3 years ago
Great and fun talk on the development of Viridis: https://www.youtube.com/watch?v=xAoljeRJ3lU
ilyt · 3 years ago
>Indeed for her kind of data the rainbow palette works okay. But if you have to visualize more complex / denser data, beware of the pitfalls of the rainbow color palette. It is not always the best choice.

There is already a trap in this palette, the first color looks awfully like the last. It's fine if you just want a palette for a bunch of lines but using it for heatmap could be a bit misleading in edge cases

twelvechairs · 3 years ago
> (1) Hue was not a good dimension for encoding magnitude information, i.e. rainbow color maps are bad.

Your inference doesnt follow from the first point. Hue is bad for magnitude because you dont see a different hue as 'more' or 'less' just 'different'. Hue is great for representing difference without defining one as a focus or preference over the other.

azalemeth · 3 years ago
This is a whole area of research (as you probably know). I personally only like HSV colourmaps for visualisations of phase, as it has no boundaries at the edges and therefore when you wrap over 2π again you don't get a hard discontinuity. Often you're not actually interested in what the "number" is, but how quickly it is cycling – something that it gets across quite well.
sj4nz · 3 years ago
I agree that trying to use hue for encoding magnatude information is not great, but man, how many times have I given up on someone's infographic that decided to use four different shades of blue and purple you can't tell apart when the markers are only eight or sixteen pixels on the screen.

I should hope the 12-bit rainbow palette would be adopted for those kinds of visualizations.

IIAOPSW · 3 years ago
I have a pet theory that certain high spatial frequencies bleed into being perceived a colors anyway. The reason being that the red, green, and blue cones in the retina each have a different amount of space between them but are otherwise organized in the same pattern. Thus if the brain sees something with the same spacing as the blue cones, its going to assume that's caused by it being a blue object (rather than a black/white object which happened to have the same spatial freq as the blue cells). You seem to know the literature here, is there anything validating or invalidating my pet theory?
nyanpasu64 · 3 years ago
I've never noticed such happening by eyes, but I've definitely seen distant ocean reflections (tiny randomly-shifting specks of light) being misinterpreted as colors by Bayer matrix camera sensors.
hunter2_ · 3 years ago
I'm no expert, but that sounds a lot like how halftone and dithering work.
photoGrant · 3 years ago
This is called metameric failure
nine_k · 3 years ago
What is often needed in visualizations is showing several parameters next to each other. Think not color maps that showvariation of one value, like a heat map, but line or bar charts, or area maps with various pars marked.
ajuc · 3 years ago
What's wrong with grayscale? Why do we need to add confounding variables?
WastingMyTime89 · 3 years ago
Pointing that luminance is the best channel to encode spatial frequency is akin to encouraging greyscale.

It’s just that you can do it with a hue and a non zero saturation if it suits the style you are looking for.

Plus sometimes you have more than on me set of data mixed and it’s useful to be able to distinguish both by using multiple colours.

visarga · 3 years ago
When you want to plot a categorical distribution you need to encode category by colour, but you want them to appear maximally distinctive.
dqh · 3 years ago
I really like this, but FYI I do struggle to tell the difference between the first and last colour. There are probably others out there with this problem.
marcuskaz · 3 years ago
You might have a slight color deficiency, you can try this online color vision acuity test: https://www.xrite.com/hue-test
kortex · 3 years ago
I scored a perfect 0 and while I can tell the difference, it's still pretty close. Purple/violet colors are just hard to discern in general.
hayley-patton · 3 years ago
I did it, decided to compare results, and saw

> Best Score for your Gender -69420

> Worst Score for your Gender 1000000000

Someone doesn't sanitize their inputs?

CamperBob2 · 3 years ago
This test has as much to do with the monitor's gamma correction and color fidelity as anything else, IMO. Whenever I was unsure of the order, dragging the window over to a different monitor helped immensely. I was able to get a 0 by doing that, which I don't think I could have done on either monitor by itself.
riffraff · 3 years ago
I scored a 0 in this test (really cool btw!) but I also have trouble distinguishing the first and last color in the palette.

I mean, I can see _some_ difference but they are very very close, and I am not sure I could distinguish them in, say, a line plot.

ilyt · 3 years ago
Not really, they are just similar if you put it next to eachother (both are essentially shades of purple/violet) and as they are at different ends of scale it could get confusing if used as heatmap
Gordonjcp · 3 years ago
My colour vision is absolutely perfect, and I wouldn't want to have to distinguish between the first and last in isolation in difficult circumstances.
ninkendo · 3 years ago
> Attention! Please rotate your phone or view this test on a larger device for best results.

It doesn’t even let me dismiss that message. Who does this? Intentionally breaking your whole site because it might not look good. (This is an iPhone 14 max, so already a pretty big screen, and I’m in portrait orientation.)

tesseract · 3 years ago
I had a hard time distinguishing them with night shift enabled on my display. With a daylight white point it was easier but they are still close.
luluthefirst · 3 years ago
The point is that the two ends of the spectrum look more similar than their own adjacent colors..
dqh · 3 years ago
Yeah, I scored a 6 where 0 is perfect.
ygjb · 3 years ago
that was a cool test, thanks for sharing it!
ww520 · 3 years ago
They do look very close. The left one has more red while the right one has more blue.
userbinator · 3 years ago
I can tell the difference but they do look very similar. The first is a brighter magenta and the bottom is a darker one.
dqh · 3 years ago
I can also tell the difference, as displayed in a rainbow, but if they were next to each other in a data visualisation I think i'd have no chance.
vgb2k18 · 3 years ago
#2cb and #0bc look the same for me, while the first and last are different enough.

I know for sure I cannot complete a full ishihara plate test though so this one is on me.

joemi · 3 years ago
Might be your monitor. I've seen some that make various similar colors look exactly the same.
fjfaase · 3 years ago
The Dutch artist Peter Struycken has made paintings with various rainbow palette, not using some kind of computer based method (although he is a prominent computer artist), but just his eyes. See: https://www.pstruycken.nl/EnS20.html (A computer program was used to design of the pattern being used in the paintings.)

He has created many colour palettes for specific buildings and applications. See: https://www.pstruycken.nl/EnDyn.html?Li,tag=q&w

nomagicbullet · 3 years ago
I'm a color nerd and I love seeing how even with such an old concept (RGB is 162 years old), people are still interested in finding opportunities to innovate. I love this palette and will be adopting it. Thanks for sharing.
hypertele-Xii · 3 years ago
RGB is a bit older than 162 years, those are the three colors the human eye percieves (excluding mutations).
ravi-delia · 3 years ago
Eh, RGB is a particular abstraction which is about that old. The human eye is way weirder even before you throw in all the luminosity stuff, and by the time the brain actually computes the color data? Forget it.
nomagicbullet · 3 years ago
Appreciate your note. I should have said the RGB color model used by humans to represent color spectrum.
p-e-w · 3 years ago
What is the advantage of restricting the palette to a color depth of 12 bits, when every display device the colors are likely to be shown on supports much higher color depth, and printing yields much wider color ranges as well?

The only hint given in the article is

> so each colour requires only four characters when specified as a hexadecimal colour code in a CSS or SVG file

but surely this can't be the answer? Such a minor technical detail doesn't seem worth deviating even slightly from the "ideal" HCL values.

tasuki · 3 years ago
I think I understand why. I think the primary reason is that it's minimalist and very much empathise with such endeavours.

There are several advantages to such minimalism: easier to read and write in code, fewer bytes to store and transfer, and perhaps also satisfying one's ocd.

Let me flip this on you: why use 6 characters to specify colours when 3 will do fine? What exactly would your "ideal" HCL values be?

p-e-w · 3 years ago
> What exactly would your "ideal" HCL values be?

The post specifically mentions that "slight changes" to the constructed HCL values "must be made" in order to conform to the 12-bit color depth. So the author first derived certain values from theoretical/aesthetic considerations, then modified them for the sole purpose of fitting into 12 bits. This doesn't make sense to me except in very, very niche cases where saving 3 bytes (or even less, considering compression) actually matters more than visual quality.

epidemian · 3 years ago
IDK it's cool to be able to write these nice colors with 3 hex characters :)
Maursault · 3 years ago
This isn't 12-bit color depth. It's a 12 color palette, so its color depth is x if 2^x=12 or

       ln(12)
       ------
        ln(2)
Color depth (or bit depth) is the number of bits used to indicate the color of a single pixel. So 24-bit color depth produces 16,777,216 colors, 12-bit color depth produces 4096 colors, 8-bit color depth produces 256 colors, and 4-bit color depth produces 16 colors. A 12 color palette is 3.58496250…-bit color depth.

chrisseaton · 3 years ago
You’re misunderstanding - they mean they’ve chosen colours from a 12-bit subset of RGB.
Maursault · 3 years ago
> You're misunderstanding

>> The palette uses a 12-bit colour depth

It is the author that has misunderstood.[1]

[1] https://en.wikipedia.org/wiki/Color_depth

Inufu · 3 years ago
The 12 bit part refers to the colours being specified using three hex letters.
gigabates · 3 years ago
It's 12-bit in the sense of 3 * 4-bits per channel.
bloopernova · 3 years ago
This was cool to read, because it indirectly taught me to understand HSV.

I've always had trouble understanding the colour spaces other than RGB. After reading that article, I understood a little more about the luminance due to the greyscale used. From there I searched for "rgb vs cmyk vs hsv" and found this: https://www.geeksforgeeks.org/difference-between-rgb-cmyk-hs... (with annoying "sign up with google" popovers)

From there I wondered if there was a visualizer for the HSV cone, and yes there is! https://color.lukas-stratmann.com/color-systems/hsv.html

So, if you're out there wondering if you should write that visualizer that you had a weird idea for, please, please do so. It may help some random internet person understand something :)

vardump · 3 years ago
That's how Amiga OCS/ECS color palette works as well, 4 bits per primary.

For whatever reason my brain considers it important enough I still remember $dff180 is the first color palette entry address. :-)

tuukkah · 3 years ago
I came across this collection of Amiga 12-bit images today: https://amiga.lychesis.net/colors/HAM.html
snvzz · 3 years ago
Like C64 remember $d020 aka 53280 ;)

Amiga owners will also remember $bfe001, $dff01c, $dff09a... but mainly $4 :P