Re: How to get the DE 94
Re: How to get the DE 94
- Subject: Re: How to get the DE 94
- From: Graeme Gill <email@hidden>
- Date: Tue, 21 Oct 2003 11:38:42 +1000
Xabier Urien wrote:
>
Thanks.. I know... but I'm developing an aplication (very simple) and I want
>
to calculate the dE94 between 2 lab colors... is easy to get the dE (simple
>
algebra) but I need the dE 94 and I dont know how...
Here the code from icclib <
http://web.access.net.au/argyll/color.html>
- Graeme Gill.
/* Return the CIE94 Delta E color difference measure */
double icmCIE94(double Lab1[3], double Lab2[3]) {
double desq, dhsq;
double dlsq, dcsq;
double c12;
{
double dl, da, db;
dl = Lab1[0] - Lab2[0];
dlsq = dl * dl; /* dl squared */
da = Lab1[1] - Lab2[1];
db = Lab1[2] - Lab2[2];
/* Compute normal Lab delta E squared */
desq = dlsq + da * da + db * db;
}
{
double c1, c2, dc;
/* Compute chromanance for the two colors */
c1 = sqrt(Lab1[1] * Lab1[1] + Lab1[2] * Lab1[2]);
c2 = sqrt(Lab2[1] * Lab2[1] + Lab2[2] * Lab2[2]);
c12 = sqrt(c1 * c2); /* Symetric chromanance */
/* delta chromanance squared */
dc = c2 - c1;
dcsq = dc * dc;
}
/* Compute delta hue squared */
if ((dhsq = desq - dlsq - dcsq) < 0.0)
dhsq = 0.0;
{
double sc, sh;
/* Weighting factors for delta chromanance & delta hue */
sc = 1.0 + 0.048 * c12;
sh = 1.0 + 0.014 * c12;
return sqrt(dlsq + dcsq/(sc * sc) + dhsq/(sh * sh));
}
}
_______________________________________________
colorsync-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/colorsync-users
Do not post admin requests to the list. They will be ignored.