I’ve implemented the CIEDE2000 color difference operator in G’MIC, which is able to compute a perceptual difference between colors. It is based on some complicated formula involving the color channels in Lab (see Wikipedia page about CIEDE2000).
It’s apparently better than just using the eucidean distance in Lab.
There are two ways of using it :
With the command ciede2000 :
$ gmic h ciede2000
gmic: GREYC's Magic for Image Computing.
(https://gmic.eu)
Version 2.8.0 (pre-release #191114)
Copyright (c) 2008-2019, David Tschumperle / GREYC Lab / CNRS.
(https://www.greyc.fr)
ciede2000:
Compute images of CIEDE2000 color difference between all selected images, assumed to be in Lab
color space.
This function returns N*(N-1)/2 images, where N is the number of images in the selection.
Example: [#1] image.jpg +blur 2 srgb2lab ciede2000
Or, if you want to use it in as a function in some math expression, there is function ciede2000() in math_lib :
foo :
f ${-math_lib}" ciede2000(I,I+2)" # <- This is useless but shows how it can be used
Next week, I’m planning to do some experiments to introduce this perceptual error as a criterion for my CLUT compression, with the hope it will become more perceptually aware
i’m not a big fan of this distance computation, however. the reason being
man invents a “perceptually uniform” colour space, Lab, with the one property that taking the euclidean distances in this space corresponds to perceptual differences. as it turns out this isn’t the case. in the following, instead of fixing the colour space, man invents new difference computation schemes in this space (DE2000 etc). seems broken.
the second item may not matter for small differences, but may well cause any optimisation scheme to be confused in the process. i’d go for the simpler and smooth (and not any more or less broken) DE76.