Just to add some complexity
Take a look to the source of my quick&dirty mosaic app, BrickMosaic.
In file "BrickColors.java" there are some references to XYZ and CIE-Lab colorspaces and CIE1994 method to measure "visual distance" between two color.
I tried some algorithm and colorspaces, but CIE-Lab + CIE1994 giving best results.
In source (file BrickColors.java):
- conversion from RGB to CIE-Lab is in function "RGB2Lab"
- color distance CIE1994 is computed in function "colorDiff_DE1994"
- I used a Java library function to convert a color from RGB to XYZ colorspace, but in source there is a commented function (RGB2XYZ) that do the same.
HTH
Mario
Take a look to the source of my quick&dirty mosaic app, BrickMosaic.
In file "BrickColors.java" there are some references to XYZ and CIE-Lab colorspaces and CIE1994 method to measure "visual distance" between two color.
I tried some algorithm and colorspaces, but CIE-Lab + CIE1994 giving best results.
In source (file BrickColors.java):
- conversion from RGB to CIE-Lab is in function "RGB2Lab"
- color distance CIE1994 is computed in function "colorDiff_DE1994"
- I used a Java library function to convert a color from RGB to XYZ colorspace, but in source there is a commented function (RGB2XYZ) that do the same.
HTH
Mario