From: cristy Date: Fri, 19 Apr 2013 20:30:10 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3833 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cdea74820f2f3eee4ab0267af1f7b4cc2a054a74;p=imagemagick --- diff --git a/MagickCore/gem.c b/MagickCore/gem.c index 99df3d45b..74560707a 100644 --- a/MagickCore/gem.c +++ b/MagickCore/gem.c @@ -867,13 +867,13 @@ MagickPrivate void ConvertRGBToLCHab(const double red,const double green, assert(hue != (double *) NULL); ConvertRGBToXYZ(red,green,blue,&X,&Y,&Z); ConvertXYZToLab(X,Y,Z,&L,&a,&b); - C=hypot(a,b); - H=180.0*atan2(b,a)/MagickPI/360.0; + C=hypot(255.0*(a-0.5)/500.0,255.0*(b-0.5)/200.0); + H=180.0*atan2(255.0*(b-0.5)/200.0,255.0*(a-0.5)/500.0)/MagickPI/360.0; if (H < 0.0) H+=1.0; if (H >= 1.0) H-=1.0; - *luma=L; + *luma=(100.0*L+16.0)/116.0; *chroma=C; *hue=H; }