]> granicus.if.org Git - imagemagick/commitdiff
Rec601Luminance and Rec709Luminance intensity methods return linear gray
authorCristy <urban-warrior@imagemagick.org>
Sun, 24 Dec 2017 18:36:03 +0000 (13:36 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sun, 24 Dec 2017 18:36:03 +0000 (13:36 -0500)
MagickCore/enhance.c

index b7532b006a8ca02e509dc5a37838e2c7cf0fe8dd..4feec90b29bfa226c0c803680be189cb540842c1 100644 (file)
@@ -1990,6 +1990,9 @@ MagickExport MagickBooleanType GrayscaleImage(Image *image,
     {
       image->intensity=method;
       image->type=GrayscaleType;
+      if ((method == Rec601LuminancePixelIntensityMethod) ||
+          (method == Rec709LuminancePixelIntensityMethod))
+        return(SetImageColorspace(image,GRAYColorspace,exception));
       return(SetImageColorspace(image,sGRAYColorspace,exception));
     }
 #endif
@@ -2134,6 +2137,9 @@ MagickExport MagickBooleanType GrayscaleImage(Image *image,
   image_view=DestroyCacheView(image_view);
   image->intensity=method;
   image->type=GrayscaleType;
+  if ((method == Rec601LuminancePixelIntensityMethod) ||
+      (method == Rec709LuminancePixelIntensityMethod))
+    return(SetImageColorspace(image,GRAYColorspace,exception));
   return(SetImageColorspace(image,sGRAYColorspace,exception));
 }
 \f