From bd66cbe3ecb61270ac3a6f6298fca8e08d6ee4e9 Mon Sep 17 00:00:00 2001 From: dirk Date: Sun, 4 Jan 2015 16:32:14 +0000 Subject: [PATCH] QuantizeImage will change the colorspace when the number of requested colors is higher than the number of colors in the image. --- MagickCore/quantize.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c index 42dc6e8ab..ab62ee3d2 100644 --- a/MagickCore/quantize.c +++ b/MagickCore/quantize.c @@ -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) { -- 2.50.1