Color Distance
Red ≠ Blue, but Red is close to pink. How would you measure the difference between two colors? If you figure out a metric for measuring the difference between two colors, you could train computers how to compare and manipulate pictures.
You could use the distance formula from Euclid using the Red-Green-Blue values from a digital picture like it were a 3D (x, y, z) way: ,
In March 2024 Tim Chartler (and friends) published Data Science Distance: When Close seems far. The article describes switching from Euclidean distance to a difference distance formula called ΔE*.
The picture below shows two ways to reduce a full color picture into a picture using only 6 colors. Each uses the same 6 colors. Each replaced every pixel with the one of the 6 colors, using the “closest” color. It comes down to how you determine “close”. The Euclidean distance is on the left, and the ΔE* distance is used on the right,
References