From d2ad935bc8989536451ebb9d065f70c2aac26aec Mon Sep 17 00:00:00 2001
From: cristy <urban-warrior@git.imagemagick.org>
Date: Tue, 7 Apr 2015 11:19:45 +0000
Subject: [PATCH]

---
 MagickCore/attribute.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c
index 047435bd6..8ae173546 100644
--- a/MagickCore/attribute.c
+++ b/MagickCore/attribute.c
@@ -1210,11 +1210,10 @@ MagickExport MagickBooleanType SetImageType(Image *image,const ImageType type,
   {
     case BilevelType:
     {
-      if (SetImageGray(image,exception) == MagickFalse)
-        status=TransformImageColorspace(image,GRAYColorspace,exception);
-      (void) NormalizeImage(image,exception);
       if (SetImageMonochrome(image,exception) == MagickFalse)
         {
+          status=TransformImageColorspace(image,GRAYColorspace,exception);
+          (void) NormalizeImage(image,exception);
           quantize_info=AcquireQuantizeInfo(image_info);
           quantize_info->number_colors=2;
           quantize_info->colorspace=GRAYColorspace;
-- 
2.40.0