====== 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: {{::sqrt_r_1_-_r_2_.png?300|}}, In March 2024 Tim Chartler (and friends) published [[https://q76y71yn.r.us-east-1.awstrack.me/L0/https:%2F%2Fpolo.feathr.co%2Fv1%2Fanalytics%2Fcrumb%3Fflvr=email_link_click%26t_id=683756fba43c73b76b6733e0%26a_id=654d018ae970b0e931530752%26e_id=6789933f87c548ea1722e898%26cpn_id=683756fba43c73b76b6733df%26per_id=65f9cc87e59097ba2d6cf2e3%26email_addr=cthiel@sfhs.net%26rdr=https%253A%252F%252Fwww.tandfonline.com%252Fdoi%252Ffull%252F10.1080%252F29932955.2024.2348432/1/0100019735a9eb6b-ef3a2664-69b9-4554-9d09-a1d68552d863-000000/sOyK2Y34X3hzJiWObHVV_pIZDvA=428| 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, {{ https://www.tandfonline.com/cms/asset/58c5a5b6-c286-461c-ba51-b79232484124/usca_a_2348432_f0006_c.jpg}} References - [[https://hajim.rochester.edu/ece/sites/gsharma/ciede2000/|CIEDE2000 color-difference formula]] - [[https://www.w3.org/Graphics/Color/sRGB.html| sRGB Matrices]] - [[https://github.com/mr-rycho/cielab-demo.git| CIELab demo]]