]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 22 Apr 2010 23:42:02 +0000 (23:42 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 22 Apr 2010 23:42:02 +0000 (23:42 +0000)
magick/colorspace.c

index 04e8088a1c598a3d80cd06e57a4c4d6c3ba01743..3a85abca8bcf376e40bd93c962fc343fb78f976f 100644 (file)
@@ -149,8 +149,12 @@ static inline void ConvertXYZToLab(const double X,const double Y,const double Z,
   else
     z=(7.787037*z)+(16.0/116.0);
   *L=((116.0*y)-16.0)/100.0;
-  *a=0.5*(500.0*(x-y))/100.0+1.0;
-  *b=0.5*(200.0*(y-z))/100.0+1.0;
+  *a=(500.0*(x-y))/255.0;
+  if (*a < 0.0)
+    *a+=1.0;
+  *b=(200.0*(y-z))/255.0;
+  if (*b < 0.0)
+    *b+=1.0;
 }
 
 MagickExport MagickBooleanType RGBTransformImage(Image *image,