I was experimenting with colour distances at work today. I need to find out how similar two colours are, so I wrote a little test program and it was surprisingly pretty.
The algorithm is simple:
1. Fill the canvas with random colours.
2. Set the first pixel (top left) to red.
3. For all pixels, find the most similar pixel and move it next to the current pixel.
To determine the similarity, I calculated the 3D distance in the RGB, HSV and YUV color spaces, which brought very different results. Now, it's quite possible that my HSV and YUV conversion functions were just broken, but that's okay.
(I recommend zooming in!)
#programming #development #cplusplus #cpp #cpp20 #immediate2d #rgb #hsv #yuv #art #pixelart #rainbow #noise #gamedev #opengl #math #mathematics