Changing webcam-pixels to "nearest" color from color palette array

In general, I don’t believe (?) that HSB distances in Processing will have less warping than RGB – I haven’t tested this, but I think that is just a different numerical representation of the same non-perceptual linear colorspace. My understanding is that whatever kind of vision you have, the excitation of your eyes in relation to input to whatever kind of rods / cones you have is curved, not linear – so estimates of “nearness” of two colors – or particularly which is nearer given three colors – when computed on linear arrangements of RGB or HSB values may produce distorted results when comparing changes in different directions through color space. Still, HSB and RGB should often be good enough. Measuring just H distance can be helpful in that it is at least easily ordered – although comparing a triangle of points on the ring can still be tricky.

That is fair–it is normative in a way that isn’t justified. There are many different perceptual colorspaces, but they share some properties. Possibly relevant is the Processing Library Color Blindness, which contains code for both Daltonization and Color Blindness Simulation.

Previous forum announcement of that library:

1 Like