Skip to content

Instantly share code, notes, and snippets.

@unot
Created September 4, 2012 03:34
Show Gist options
  • Save unot/3616264 to your computer and use it in GitHub Desktop.
Save unot/3616264 to your computer and use it in GitHub Desktop.
D50の測色データをXYZに
#! /usr/bin/awk -f
BEGIN{
Xn=96.4212
Yn=100.0
Zn=82.5188
}
{
fy=($1+16)/116
fx=fy+($2/500)
fz=fy-($3/200)
if(fy>6/29)
Y=fy^3*Yn
else
Y=(3/29)^3*(116*fy-16)*Yn
if(fx>6/29)
X=fx^3*Xn
else
X=(3/29)^3*(116*fx-16)*Xn
if(fz>6/29)
Z=fz^3*Zn
else
Z=(3/29)^3*(116*fz-16)*Zn
print X,Y,Z
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment