]> granicus.if.org Git - imagemagick/commitdiff
QuantizeImage will change the colorspace when the number of requested colors is highe...
authordirk <dirk@git.imagemagick.org>
Sun, 4 Jan 2015 16:32:14 +0000 (16:32 +0000)
committerdirk <dirk@git.imagemagick.org>
Sun, 4 Jan 2015 16:32:14 +0000 (16:32 +0000)
MagickCore/quantize.c

index 42dc6e8abb8be18e29b3f7a5ca839ee0597f9a32..ab62ee3d244a09442abe00625f4ca1a2d3bd9867 100644 (file)
@@ -2745,7 +2745,13 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info,
     }
   if ((image->storage_class == PseudoClass) &&
       (image->colors <= maximum_colors))
-    return(MagickTrue);
+    {
+      if ((quantize_info->colorspace != UndefinedColorspace) &&
+          (quantize_info->colorspace != CMYKColorspace))
+        (void) TransformImageColorspace(image,quantize_info->colorspace,
+          exception);
+      return(MagickTrue);
+    }
   depth=quantize_info->tree_depth;
   if (depth == 0)
     {