diff --git a/coders/aai.c b/coders/aai.c
index 66f0c70..0f34b75 100644
--- a/coders/aai.c
+++ b/coders/aai.c
@@ -391,7 +391,7 @@
         *q++=ScaleQuantumToChar(GetPixelBlue(image,p));
         *q++=ScaleQuantumToChar(GetPixelGreen(image,p));
         *q++=ScaleQuantumToChar(GetPixelRed(image,p));
-        *q=ScaleQuantumToChar((Quantum) (image->alpha_trait == BlendPixelTrait ?
+        *q=ScaleQuantumToChar((Quantum) (image->alpha_trait != UndefinedPixelTrait ?
           GetPixelAlpha(image,p) : OpaqueAlpha));
         if (*q == 255)
           *q=254;
diff --git a/coders/bgr.c b/coders/bgr.c
index 8dceca3..188ba16 100644
--- a/coders/bgr.c
+++ b/coders/bgr.c
@@ -254,7 +254,7 @@
                 SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -309,7 +309,7 @@
                 "UnexpectedEndOfFile",image->filename);
               break;
             }
-          for (i=0; i < (ssize_t) (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
+          for (i=0; i < (ssize_t) (image->alpha_trait != UndefinedPixelTrait ? 4 : 3); i++)
           {
             quantum_type=quantum_types[i];
             q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -552,7 +552,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -836,7 +836,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1111,7 +1111,7 @@
     */
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
     if ((LocaleCompare(image_info->magick,"BGRA") == 0) &&
-        (image->alpha_trait != BlendPixelTrait))
+        (image->alpha_trait == UndefinedPixelTrait))
       (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)
diff --git a/coders/bmp.c b/coders/bmp.c
index a536e86..25ef657 100644
--- a/coders/bmp.c
+++ b/coders/bmp.c
@@ -974,7 +974,7 @@
           If we find a non zero value we asume the program that wrote the file
           wants to use the alpha channel.
         */
-        if ((image->alpha_trait != BlendPixelTrait) && (bmp_info.size == 40) &&
+        if ((image->alpha_trait == UndefinedPixelTrait) && (bmp_info.size == 40) &&
             (bmp_info.bits_per_pixel == 32))
           {
             bytes_per_line=4*(image->columns);
@@ -993,7 +993,7 @@
               }
             }
           }
-        bmp_info.alpha_mask=image->alpha_trait == BlendPixelTrait ?
+        bmp_info.alpha_mask=image->alpha_trait != UndefinedPixelTrait ?
           0xff000000U : 0U;
         bmp_info.red_mask=0x00ff0000U;
         bmp_info.green_mask=0x0000ff00U;
@@ -1217,7 +1217,7 @@
             SetPixelGreen(image,ScaleShortToQuantum((unsigned short) green),q);
             SetPixelBlue(image,ScaleShortToQuantum((unsigned short) blue),q);
             SetPixelAlpha(image,OpaqueAlpha,q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 alpha=((pixel & bmp_info.alpha_mask) << shift.alpha) >> 16;
                 if (quantum_bits.alpha <= 8)
@@ -1315,7 +1315,7 @@
             SetPixelGreen(image,ScaleShortToQuantum((unsigned short) green),q);
             SetPixelBlue(image,ScaleShortToQuantum((unsigned short) blue),q);
             SetPixelAlpha(image,OpaqueAlpha,q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 alpha=((pixel & bmp_info.alpha_mask) << shift.alpha) >> 16;
                 if (quantum_bits.alpha == 8)
@@ -1625,7 +1625,7 @@
         if (image_info->compression == RLECompression)
           bmp_info.bits_per_pixel=8;
         bmp_info.number_colors=1U << bmp_info.bits_per_pixel;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           (void) SetImageStorageClass(image,DirectClass,exception);
         else
           if ((size_t) bmp_info.number_colors < image->colors)
@@ -1648,9 +1648,9 @@
         */
         bmp_info.number_colors=0;
         bmp_info.bits_per_pixel=(unsigned short)
-          ((type > 3) && (image->alpha_trait == BlendPixelTrait) ? 32 : 24);
+          ((type > 3) && (image->alpha_trait != UndefinedPixelTrait) ? 32 : 24);
         bmp_info.compression=(unsigned int) ((type > 3) &&
-          (image->alpha_trait == BlendPixelTrait) ?  BI_BITFIELDS : BI_RGB);
+          (image->alpha_trait != UndefinedPixelTrait) ?  BI_BITFIELDS : BI_RGB);
       }
     bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32);
     bmp_info.ba_offset=0;
@@ -1661,7 +1661,7 @@
     if (type == 2)
       bmp_info.size=12;
     else
-      if ((type == 3) || ((image->alpha_trait != BlendPixelTrait) &&
+      if ((type == 3) || ((image->alpha_trait == UndefinedPixelTrait) &&
           (have_color_info == MagickFalse)))
         {
           type=3;
@@ -1949,7 +1949,7 @@
             "   Storage class=PseudoClass");
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "   Image depth=%.20g",(double) image->depth);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "   Matte=True");
         else
@@ -2023,7 +2023,7 @@
         (void) WriteBlobLSBLong(image,bmp_info.number_colors);
         (void) WriteBlobLSBLong(image,bmp_info.colors_important);
       }
-    if ((type > 3) && ((image->alpha_trait == BlendPixelTrait) ||
+    if ((type > 3) && ((image->alpha_trait != UndefinedPixelTrait) ||
         (have_color_info != MagickFalse)))
       {
         /*
diff --git a/coders/cmyk.c b/coders/cmyk.c
index 2a5335b..fd33679 100644
--- a/coders/cmyk.c
+++ b/coders/cmyk.c
@@ -256,7 +256,7 @@
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
                 SetPixelBlack(image,GetPixelBlack(canvas_image,p),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -312,7 +312,7 @@
                 "UnexpectedEndOfFile",image->filename);
               break;
             }
-          for (i=0; i < (image->alpha_trait == BlendPixelTrait ? 5 : 4); i++)
+          for (i=0; i < (image->alpha_trait != UndefinedPixelTrait ? 5 : 4); i++)
           {
             quantum_type=quantum_types[i];
             q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -601,7 +601,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -956,7 +956,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1228,7 +1228,7 @@
     if (LocaleCompare(image_info->magick,"CMYKA") == 0)
       {
         quantum_type=CMYKAQuantum;
-        if (image->alpha_trait != BlendPixelTrait)
+        if (image->alpha_trait == UndefinedPixelTrait)
           (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       }
     quantum_info=AcquireQuantumInfo(image_info,image);
diff --git a/coders/dds.c b/coders/dds.c
index 9ce9cf4..006b201 100644
--- a/coders/dds.c
+++ b/coders/dds.c
@@ -1986,7 +1986,7 @@
               SetPixelGreen(image,ScaleCharToQuantum(colors.g[code]),q);
               SetPixelBlue(image,ScaleCharToQuantum(colors.b[code]),q);
               SetPixelAlpha(image,ScaleCharToQuantum(colors.a[code]),q);
-              if (colors.a[code] && (image->alpha_trait != BlendPixelTrait))
+              if (colors.a[code] && (image->alpha_trait == UndefinedPixelTrait))
                 image->alpha_trait=BlendPixelTrait;  /* Correct matte */
               q+=GetPixelChannels(image);
             }
@@ -2672,7 +2672,7 @@
   pixelFormat=DDPF_FOURCC;
   compression=FOURCC_DXT5;
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     compression=FOURCC_DXT1;
 
   if (LocaleCompare(image_info->magick,"dxt1") == 0)
@@ -2765,7 +2765,7 @@
       caps=caps | (unsigned int) (DDSCAPS_MIPMAP | DDSCAPS_COMPLEX);
     }
 
-  if (format != DDPF_FOURCC && image->alpha_trait == BlendPixelTrait)
+  if (format != DDPF_FOURCC && image->alpha_trait != UndefinedPixelTrait)
     format=format | DDPF_ALPHAPIXELS;
 
   (void) WriteBlob(image,4,(unsigned char *) "DDS ");
@@ -2799,7 +2799,7 @@
   else
     {
       (void) WriteBlobLSBLong(image,0x00);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           (void) WriteBlobLSBLong(image,32);
           (void) WriteBlobLSBLong(image,0xff0000);
@@ -3119,7 +3119,7 @@
       (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelBlue(image,p)));
       (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelGreen(image,p)));
       (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelRed(image,p)));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelAlpha(image,p)));
       p+=GetPixelChannels(image);
     }
diff --git a/coders/debug.c b/coders/debug.c
index 645e7e4..08a0e8a 100644
--- a/coders/debug.c
+++ b/coders/debug.c
@@ -208,7 +208,7 @@
       MagickColorspaceOptions,(ssize_t) image->colorspace),MaxTextExtent);
     LocaleLower(colorspace);
     image->depth=GetImageQuantumDepth(image,MagickTrue);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       (void) ConcatenateMagickString(colorspace,"a",MaxTextExtent);
     (void) FormatLocaleString(buffer,MaxTextExtent,
       "# ImageMagick pixel debugging: %.20g,%.20g,%.20g,%s\n",(double)
@@ -238,7 +238,7 @@
               (double) pixel.black);
             (void) ConcatenateMagickString(tuple,black,MaxTextExtent);
           }
-        if (pixel.alpha_trait == BlendPixelTrait)
+        if (pixel.alpha_trait != UndefinedPixelTrait)
           {
             char
               alpha[MaxTextExtent];
diff --git a/coders/dib.c b/coders/dib.c
index 9ad1565..17df06a 100644
--- a/coders/dib.c
+++ b/coders/dib.c
@@ -875,7 +875,7 @@
           SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
           SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
           SetPixelRed(image,ScaleCharToQuantum(*p++),q);
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
           q+=GetPixelChannels(image);
         }
@@ -1235,7 +1235,7 @@
           *q++=ScaleQuantumToChar(GetPixelBlue(image,p));
           *q++=ScaleQuantumToChar(GetPixelGreen(image,p));
           *q++=ScaleQuantumToChar(GetPixelRed(image,p));
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             *q++=ScaleQuantumToChar(GetPixelAlpha(image,p));
           p+=GetPixelChannels(image);
         }
diff --git a/coders/dpx.c b/coders/dpx.c
index 6ad812b..afa2d60 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -1623,17 +1623,17 @@
         case YCbCrColorspace:
         {
           dpx.image.image_element[i].descriptor=CbYCr444ComponentType;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             dpx.image.image_element[i].descriptor=CbYCrA4444ComponentType;
           break;
         }
         default:
         {
           dpx.image.image_element[i].descriptor=RGBComponentType;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             dpx.image.image_element[i].descriptor=RGBAComponentType;
           if ((image_info->type != TrueColorType) &&
-              (image->alpha_trait != BlendPixelTrait) &&
+              (image->alpha_trait == UndefinedPixelTrait) &&
               (IsImageGray(image,exception) != MagickFalse))
             dpx.image.image_element[i].descriptor=LumaComponentType;
           break;
@@ -1953,20 +1953,20 @@
   SetQuantumPack(quantum_info,dpx.image.image_element[0].packing == 0 ?
     MagickTrue : MagickFalse);
   quantum_type=RGBQuantum;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     quantum_type=RGBAQuantum;
   if (image->colorspace == YCbCrColorspace)
     {
       quantum_type=CbYCrQuantum;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         quantum_type=CbYCrAQuantum;
       if ((horizontal_factor == 2) || (vertical_factor == 2))
         quantum_type=CbYCrYQuantum;
     }
-  extent=GetBytesPerRow(image->columns,image->alpha_trait == BlendPixelTrait ?
+  extent=GetBytesPerRow(image->columns,image->alpha_trait != UndefinedPixelTrait ?
     4UL : 3UL,image->depth,MagickTrue);
   if ((image_info->type != TrueColorType) &&
-      (image->alpha_trait != BlendPixelTrait) &&
+      (image->alpha_trait == UndefinedPixelTrait) &&
       (IsImageGray(image,exception) != MagickFalse))
     {
       quantum_type=GrayQuantum;
diff --git a/coders/exr.c b/coders/exr.c
index 0a07336..8e35b5d 100644
--- a/coders/exr.c
+++ b/coders/exr.c
@@ -460,7 +460,7 @@
       scanline[x].g=half_quantum;
       ImfFloatToHalf(QuantumScale*GetPixelBlue(image,p),&half_quantum);
       scanline[x].b=half_quantum;
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         ImfFloatToHalf(1.0,&half_quantum);
       else
         ImfFloatToHalf(QuantumScale*GetPixelAlpha(image,p),&half_quantum);
diff --git a/coders/fpx.c b/coders/fpx.c
index 489c3e9..7b15318 100644
--- a/coders/fpx.c
+++ b/coders/fpx.c
@@ -442,7 +442,7 @@
           SetPixelBlue(image,index,q);
         }
       SetPixelAlpha(image,OpaqueAlpha,q);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         SetPixelAlpha(image,ScaleCharToQuantum(*a),q);
       q+=GetPixelChannels(image);
       r+=red_component->columnStride;
@@ -834,7 +834,7 @@
   tile_width=64;
   tile_height=64;
   colorspace.numberOfComponents=3;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     colorspace.numberOfComponents=4;
   if ((image_info->type != TrueColorType) &&
       (IsImageGray(image,exception) != MagickFalse))
@@ -955,7 +955,7 @@
     Write image pixelss.
   */
   quantum_type=RGBQuantum;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     quantum_type=RGBAQuantum;
   if (fpx_info.numberOfComponents == 1)
     quantum_type=GrayQuantum;
diff --git a/coders/gradient.c b/coders/gradient.c
index 1f536c0..2f94701 100644
--- a/coders/gradient.c
+++ b/coders/gradient.c
@@ -162,7 +162,7 @@
       return((Image *) NULL);
     }
   image->alpha_trait=start_color.alpha_trait;
-  if (stop_color.alpha_trait == BlendPixelTrait)
+  if (stop_color.alpha_trait != UndefinedPixelTrait)
     image->alpha_trait=stop_color.alpha_trait;
   status=GradientImage(image,LocaleCompare(image_info->magick,"GRADIENT") == 0 ?
     LinearGradient : RadialGradient,PadSpread,&start_color,&stop_color,
diff --git a/coders/icon.c b/coders/icon.c
index 2769f5f..50bfed6 100644
--- a/coders/icon.c
+++ b/coders/icon.c
@@ -1223,7 +1223,7 @@
                 *q++=ScaleQuantumToChar(GetPixelBlue(next,p));
                 *q++=ScaleQuantumToChar(GetPixelGreen(next,p));
                 *q++=ScaleQuantumToChar(GetPixelRed(next,p));
-                if (next->alpha_trait != BlendPixelTrait)
+                if (next->alpha_trait == UndefinedPixelTrait)
                   *q++=ScaleQuantumToChar(QuantumRange);
                 else
                   *q++=ScaleQuantumToChar(GetPixelAlpha(next,p));
@@ -1317,7 +1317,7 @@
           for (x=0; x < (ssize_t) next->columns; x++)
           {
             byte<<=1;
-            if ((next->alpha_trait == BlendPixelTrait) &&
+            if ((next->alpha_trait != UndefinedPixelTrait) &&
                 (GetPixelAlpha(next,p) == (Quantum) TransparentAlpha))
               byte|=0x01;
             bit++;
diff --git a/coders/jp2.c b/coders/jp2.c
index e77801a..9e8f049 100644
--- a/coders/jp2.c
+++ b/coders/jp2.c
@@ -937,7 +937,7 @@
           channels=1;
           jp2_colorspace=OPJ_CLRSPC_GRAY;
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channels++;
     }
   parameters.tcp_mct=channels == 3 ? 1 : 0;
diff --git a/coders/json.c b/coders/json.c
index 2560713..e9c4d0c 100644
--- a/coders/json.c
+++ b/coders/json.c
@@ -653,7 +653,7 @@
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelLocations(file,image,AlphaPixelChannel,"Alpha",
           type,max_locations,channel_statistics);
       channel_statistics=(ChannelStatistics *) RelinquishMagickMemory(
@@ -736,7 +736,7 @@
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) FormatLocaleFile(file,"    alpha: %.20g-bit\n",(double)
           channel_statistics[AlphaPixelChannel].depth);
       scale=1;
@@ -781,7 +781,7 @@
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelStatistics(file,AlphaPixelChannel,"Alpha",1.0/
           scale,channel_statistics);
       if (colorspace != GRAYColorspace)
@@ -828,7 +828,7 @@
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",
           channel_moments);
       channel_moments=(ChannelMoments *) RelinquishMagickMemory(
@@ -837,7 +837,7 @@
   if (channel_phash != (ChannelPerceptualHash *) NULL)
     {
       (void) FormatLocaleFile(file,"    \"channelPerceptualHash\": {\n");
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelPerceptualHash(file,AlphaChannel,"alphaAlpha",
           MagickTrue,channel_phash);
       (void) PrintChannelPerceptualHash(file,RedChannel,"redHue",MagickTrue,
@@ -886,7 +886,7 @@
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",
           channel_features);
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
@@ -898,7 +898,7 @@
         (void) FormatLocaleFile(file,"  Total ink density: %.0f%%\n",100.0*
           GetImageTotalInkDensity(image,exception)/(double) QuantumRange);
       x=0;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           register const Quantum
             *p;
@@ -974,7 +974,7 @@
                 ConcatenateColorComponent(&pixel,BlackPixelChannel,
                   X11Compliance,tuple);
               }
-            if (pixel.alpha_trait == BlendPixelTrait)
+            if (pixel.alpha_trait != UndefinedPixelTrait)
               {
                 (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
                 ConcatenateColorComponent(&pixel,AlphaPixelChannel,
diff --git a/coders/matte.c b/coders/matte.c
index 937d884..988064e 100644
--- a/coders/matte.c
+++ b/coders/matte.c
@@ -175,7 +175,7 @@
   ssize_t
     y;
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     ThrowWriterException(CoderError,"ImageDoesNotHaveAnAlphaChannel");
   matte_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
   if (matte_image == (Image *) NULL)
diff --git a/coders/msl.c b/coders/msl.c
index d5de506..97ad502 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -1952,7 +1952,7 @@
                         }
                       (void) SetImageArtifact(msl_info->image[n],
                                             "compose:args",value);
-                      if (composite_image->alpha_trait != BlendPixelTrait)
+                      if (composite_image->alpha_trait == UndefinedPixelTrait)
                         (void) SetImageAlpha(composite_image,OpaqueAlpha,
                           exception);
                       composite_view=AcquireAuthenticCacheView(composite_image,exception);
diff --git a/coders/pcx.c b/coders/pcx.c
index e9861c0..60b696d 100644
--- a/coders/pcx.c
+++ b/coders/pcx.c
@@ -629,7 +629,7 @@
             SetPixelRed(image,ScaleCharToQuantum(*r++),q);
             SetPixelGreen(image,ScaleCharToQuantum(*r++),q);
             SetPixelBlue(image,ScaleCharToQuantum(*r++),q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum(*r++),q);
           }
         q+=GetPixelChannels(image);
@@ -962,7 +962,7 @@
     if ((image->storage_class == DirectClass) || (image->colors > 256))
       {
         pcx_info.planes=3;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           pcx_info.planes++;
       }
     pcx_info.bytes_per_line=(unsigned short) (((size_t) image->columns*
diff --git a/coders/pdf.c b/coders/pdf.c
index 94de9c6..13b8978 100644
--- a/coders/pdf.c
+++ b/coders/pdf.c
@@ -1190,7 +1190,7 @@
   if (image_info->compression == JPEG2000Compression)
     version=(size_t) MagickMax(version,5);
   for (next=image; next != (Image *) NULL; next=GetNextImageInList(next))
-    if (next->alpha_trait == BlendPixelTrait)
+    if (next->alpha_trait != UndefinedPixelTrait)
       version=(size_t) MagickMax(version,4);
   if (LocaleCompare(image_info->magick,"PDFA") == 0)
     version=(size_t) MagickMax(version,6);
@@ -1326,7 +1326,7 @@
       case Group4Compression:
       {
         if ((IsImageMonochrome(image,exception) == MagickFalse) ||
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           compression=RLECompression;
         break;
       }
@@ -1659,7 +1659,7 @@
       (compression == FaxCompression) || (compression == Group4Compression) ?
       1 : 8);
     (void) WriteBlobString(image,buffer);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       {
         (void) FormatLocaleString(buffer,MaxTextExtent,"/SMask %.20g 0 R\n",
           (double) object+7);
@@ -2522,7 +2522,7 @@
       object);
     (void) WriteBlobString(image,buffer);
     (void) WriteBlobString(image,"<<\n");
-    if (image->alpha_trait != BlendPixelTrait)
+    if (image->alpha_trait == UndefinedPixelTrait)
       (void) WriteBlobString(image,">>\n");
     else
       {
diff --git a/coders/pict.c b/coders/pict.c
index 33a69b2..175e503 100644
--- a/coders/pict.c
+++ b/coders/pict.c
@@ -1108,7 +1108,7 @@
                 tile_image->resolution.x=(double) pixmap.horizontal_resolution;
                 tile_image->resolution.y=(double) pixmap.vertical_resolution;
                 tile_image->units=PixelsPerInchResolution;
-                if (tile_image->alpha_trait == BlendPixelTrait)
+                if (tile_image->alpha_trait != UndefinedPixelTrait)
                   image->alpha_trait=tile_image->alpha_trait;
               }
             if ((code != 0x9a) && (code != 0x9b))
@@ -1226,7 +1226,7 @@
                           (unsigned char) ((j & 0x1f) << 3)),q);
                       }
                     else
-                      if (tile_image->alpha_trait != BlendPixelTrait)
+                      if (tile_image->alpha_trait == UndefinedPixelTrait)
                         {
                           if (p > (pixels+extent+2*image->columns))
                             ThrowReaderException(CorruptImageError,
@@ -1680,7 +1680,7 @@
     storage_class=DirectClass;
   if (storage_class == DirectClass)
     {
-      pixmap.component_count=image->alpha_trait == BlendPixelTrait ? 4 : 3;
+      pixmap.component_count=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
       pixmap.pixel_type=16;
       pixmap.bits_per_pixel=32;
       pixmap.pack_type=0x04;
@@ -1692,7 +1692,7 @@
   */
   bytes_per_line=image->columns;
   if (storage_class == DirectClass)
-    bytes_per_line*=image->alpha_trait == BlendPixelTrait ? 4 : 3;
+    bytes_per_line*=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
   buffer=(unsigned char *) AcquireQuantumMemory(PictInfoSize,sizeof(*buffer));
   packed_scanline=(unsigned char *) AcquireQuantumMemory((size_t)
    (row_bytes+MaxCount),sizeof(*packed_scanline));
@@ -1964,7 +1964,7 @@
           red=scanline;
           green=scanline+image->columns;
           blue=scanline+2*image->columns;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             {
               opacity=scanline;
               red=scanline+image->columns;
@@ -1976,7 +1976,7 @@
             *red++=ScaleQuantumToChar(GetPixelRed(image,p));
             *green++=ScaleQuantumToChar(GetPixelGreen(image,p));
             *blue++=ScaleQuantumToChar(GetPixelBlue(image,p));
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               *opacity++=ScaleQuantumToChar((Quantum) (GetPixelAlpha(image,p)));
             p+=GetPixelChannels(image);
           }
diff --git a/coders/png.c b/coders/png.c
index cd38fe7..145dd94 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -3775,7 +3775,7 @@
         BlendPixelTrait : UndefinedPixelTrait;
 
 #if 0  /* I'm not sure what's wrong here but it does not work. */
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
     {
       if (ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
         (void) SetImageType(image,GrayscaleMatteType,exception);
@@ -4689,7 +4689,7 @@
                exception);
              q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
 
-             if (image->alpha_trait == BlendPixelTrait)
+             if (image->alpha_trait != UndefinedPixelTrait)
                for (x=(ssize_t) image->columns; x != 0; x--)
                {
                   SetPixelAlpha(image,GetPixelRed(jng_image,s),q);
@@ -6529,7 +6529,7 @@
 #define QM Quantum
 #endif
 
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                    (void) SetImageBackgroundColor(large_image,exception);
 
                 else
@@ -6668,7 +6668,7 @@
                                  ((ssize_t) (m*2))
                                  +GetPixelBlue(image,pixels)))),q);
 
-                              if (image->alpha_trait == BlendPixelTrait)
+                              if (image->alpha_trait != UndefinedPixelTrait)
                                  SetPixelAlpha(large_image, ((QM) (((ssize_t)
                                     (2*i*(GetPixelAlpha(image,n)
                                     -GetPixelAlpha(image,pixels)+m))
@@ -6825,7 +6825,7 @@
                                  -GetPixelBlue(image,pixels))+m)
                                  /((ssize_t) (m*2))+
                                  GetPixelBlue(image,pixels)),q);
-                              if (image->alpha_trait == BlendPixelTrait)
+                              if (image->alpha_trait != UndefinedPixelTrait)
                                  SetPixelAlpha(image,(QM) ((2*i*(
                                    GetPixelAlpha(image,n)
                                    -GetPixelAlpha(image,pixels))+m)
@@ -8365,7 +8365,7 @@
   if (mng_info->write_png_colortype &&
      (mng_info->write_png_colortype > 4 || (mng_info->write_png_depth >= 8 &&
      mng_info->write_png_colortype < 4 &&
-     image->alpha_trait != BlendPixelTrait)))
+     image->alpha_trait == UndefinedPixelTrait)))
   {
      /* Avoid the expensive BUILD_PALETTE operation if we're sure that we
       * are not going to need the result.
@@ -8374,7 +8374,7 @@
         mng_info->write_png_colortype == 5)
        ping_have_color=MagickFalse;
 
-     if (image->alpha_trait == BlendPixelTrait)
+     if (image->alpha_trait != UndefinedPixelTrait)
        {
          number_transparent = 2;
          number_semitransparent = 1;
@@ -8510,7 +8510,7 @@
 
        for (x=0; x < (ssize_t) image->columns; x++)
        {
-           if (image->alpha_trait != BlendPixelTrait ||
+           if (image->alpha_trait == UndefinedPixelTrait ||
               GetPixelAlpha(image,q) == OpaqueAlpha)
              {
                if (number_opaque < 259)
@@ -8814,7 +8814,7 @@
               {
                 for (i=0; i< (ssize_t) image_colors; i++)
                 {
-                  if ((image->alpha_trait != BlendPixelTrait ||
+                  if ((image->alpha_trait == UndefinedPixelTrait ||
                       image->colormap[i].alpha == GetPixelAlpha(image,q)) &&
                       image->colormap[i].red == GetPixelRed(image,q) &&
                       image->colormap[i].green == GetPixelGreen(image,q) &&
@@ -9281,7 +9281,7 @@
   quantum_info = (QuantumInfo *) NULL;
   number_colors=0;
   image_colors=(int) image->colors;
-  image_matte=image->alpha_trait == BlendPixelTrait ? MagickTrue : MagickFalse;
+  image_matte=image->alpha_trait != UndefinedPixelTrait ? MagickTrue : MagickFalse;
 
   if (mng_info->write_png_colortype < 5)
     mng_info->IsPalette=image->storage_class == PseudoClass &&
@@ -9730,7 +9730,7 @@
 
       if (ping_color_type == PNG_COLOR_TYPE_GRAY)
         {
-          if (image->alpha_trait != BlendPixelTrait && ping_have_non_bw == MagickFalse)
+          if (image->alpha_trait == UndefinedPixelTrait && ping_have_non_bw == MagickFalse)
              ping_bit_depth=1;
         }
 
@@ -10406,7 +10406,7 @@
         "Cannot write image with defined png:bit-depth or png:color-type.");
     }
 
-  if (image_matte != MagickFalse && image->alpha_trait != BlendPixelTrait)
+  if (image_matte != MagickFalse && image->alpha_trait == UndefinedPixelTrait)
     {
       /* Add an opaque matte channel */
       image->alpha_trait = BlendPixelTrait;
@@ -11597,7 +11597,7 @@
       mng_info->write_png_depth = 8;
       image->depth = 8;
 
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) SetImageType(image,TrueColorMatteType,exception);
 
       else
@@ -11623,7 +11623,7 @@
       mng_info->write_png_depth = 16;
       image->depth = 16;
 
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) SetImageType(image,TrueColorMatteType,exception);
 
       else
@@ -12168,7 +12168,7 @@
 
   status=MagickTrue;
   transparent=image_info->type==GrayscaleMatteType ||
-     image_info->type==TrueColorMatteType || image->alpha_trait == BlendPixelTrait;
+     image_info->type==TrueColorMatteType || image->alpha_trait != UndefinedPixelTrait;
 
   jng_alpha_sample_depth = 0;
 
@@ -12880,7 +12880,7 @@
            "    Scene: %.20g\n,   Image depth: %.20g",
            (double) scene++, (double) p->depth);
 
-        if (p->alpha_trait == BlendPixelTrait)
+        if (p->alpha_trait != UndefinedPixelTrait)
           (void) LogMagickEvent(CoderEvent,GetMagickModule(),
             "      Matte: True");
 
@@ -12974,11 +12974,11 @@
         if (next_image->page.x || next_image->page.y)
           need_defi=MagickTrue;
 
-        if (next_image->alpha_trait == BlendPixelTrait)
+        if (next_image->alpha_trait != UndefinedPixelTrait)
           need_matte=MagickTrue;
 
         if ((int) next_image->dispose >= BackgroundDispose)
-          if ((next_image->alpha_trait == BlendPixelTrait) ||
+          if ((next_image->alpha_trait != UndefinedPixelTrait) ||
                next_image->page.x || next_image->page.y ||
               ((next_image->columns < mng_info->page.width) &&
                (next_image->rows < mng_info->page.height)))
@@ -12998,7 +12998,7 @@
         /*
           check for global palette possibility.
         */
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
            need_local_plte=MagickTrue;
 
         if (need_local_plte == 0)
@@ -13351,7 +13351,7 @@
        Write MNG BACK chunk and global bKGD chunk, if the image is transparent
        or does not cover the entire frame.
      */
-     if (write_mng && ((image->alpha_trait == BlendPixelTrait) ||
+     if (write_mng && ((image->alpha_trait != UndefinedPixelTrait) ||
          image->page.x > 0 || image->page.y > 0 || (image->page.width &&
          (image->page.width+image->page.x < mng_info->page.width))
          || (image->page.height && (image->page.height+image->page.y
diff --git a/coders/pnm.c b/coders/pnm.c
index 485d8b8..5078e4a 100644
--- a/coders/pnm.c
+++ b/coders/pnm.c
@@ -946,7 +946,7 @@
             break;
           }
         }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channels++;
         if (image->depth <= 8)
           extent=channels*image->columns;
@@ -1036,7 +1036,7 @@
                         p=PushCharPixel(p,&pixel);
                         SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushCharPixel(p,&pixel);
                             if (image->depth != 1)
@@ -1061,7 +1061,7 @@
                         SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),
                           q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushShortPixel(MSBEndian,p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1076,7 +1076,7 @@
                     p=PushLongPixel(MSBEndian,p,&pixel);
                     SetPixelGray(image,ScaleAnyToQuantum(pixel,max_value),q);
                     SetPixelAlpha(image,OpaqueAlpha,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         p=PushLongPixel(MSBEndian,p,&pixel);
                         SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1107,7 +1107,7 @@
                         p=PushCharPixel(p,&pixel);
                         SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushCharPixel(p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1133,7 +1133,7 @@
                         p=PushShortPixel(MSBEndian,p,&pixel);
                         SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushShortPixel(MSBEndian,p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1153,7 +1153,7 @@
                     p=PushLongPixel(MSBEndian,p,&pixel);
                     SetPixelBlack(image,ScaleAnyToQuantum(pixel,max_value),q);
                     SetPixelAlpha(image,OpaqueAlpha,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         p=PushLongPixel(MSBEndian,p,&pixel);
                         SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1181,7 +1181,7 @@
                         p=PushCharPixel(p,&pixel);
                         SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushCharPixel(p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1204,7 +1204,7 @@
                         p=PushShortPixel(MSBEndian,p,&pixel);
                         SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
                         SetPixelAlpha(image,OpaqueAlpha,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             p=PushShortPixel(MSBEndian,p,&pixel);
                             SetPixelAlpha(image,ScaleAnyToQuantum(pixel,
@@ -1223,7 +1223,7 @@
                     p=PushLongPixel(MSBEndian,p,&pixel);
                     SetPixelBlue(image,ScaleAnyToQuantum(pixel,max_value),q);
                     SetPixelAlpha(image,OpaqueAlpha,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         p=PushLongPixel(MSBEndian,p,&pixel);
                         SetPixelAlpha(image,ScaleAnyToQuantum(pixel,max_value),q);
@@ -1689,14 +1689,14 @@
           default:
           {
             quantum_type=RGBQuantum;
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               quantum_type=RGBAQuantum;
             packet_size=3;
             (void) CopyMagickString(type,"RGB",MaxTextExtent);
             break;
           }
         }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             packet_size++;
             (void) ConcatenateMagickString(type,"_ALPHA",MaxTextExtent);
@@ -2203,7 +2203,7 @@
                         pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(
                           image,p)),max_value);
                         q=PopCharPixel((unsigned char) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=(unsigned char) ScaleQuantumToAny(
                               GetPixelAlpha(image,p),max_value);
@@ -2220,7 +2220,7 @@
                         pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(
                           image,p)),max_value);
                         q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=(unsigned char) ScaleQuantumToAny(
                               GetPixelAlpha(image,p),max_value);
@@ -2235,7 +2235,7 @@
                     pixel=ScaleQuantumToAny(ClampToQuantum(GetPixelLuma(image,
                       p)),max_value);
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         pixel=(unsigned char) ScaleQuantumToAny(
                           GetPixelAlpha(image,p),max_value);
@@ -2263,7 +2263,7 @@
                         pixel=ScaleQuantumToAny(GetPixelBlack(image,p),
                           max_value);
                         q=PopCharPixel((unsigned char) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2288,7 +2288,7 @@
                         pixel=ScaleQuantumToAny(GetPixelBlack(image,p),
                           max_value);
                         q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2308,7 +2308,7 @@
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
                     pixel=ScaleQuantumToAny(GetPixelBlack(image,p),max_value);
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                           max_value);
@@ -2332,7 +2332,7 @@
                         pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
                           max_value);
                         q=PopCharPixel((unsigned char) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2354,7 +2354,7 @@
                         pixel=ScaleQuantumToAny(GetPixelBlue(image,p),
                           max_value);
                         q=PopShortPixel(MSBEndian,(unsigned short) pixel,q);
-                        if (image->alpha_trait == BlendPixelTrait)
+                        if (image->alpha_trait != UndefinedPixelTrait)
                           {
                             pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                               max_value);
@@ -2372,7 +2372,7 @@
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
                     pixel=ScaleQuantumToAny(GetPixelBlue(image,p),max_value);
                     q=PopLongPixel(MSBEndian,(unsigned int) pixel,q);
-                    if (image->alpha_trait == BlendPixelTrait)
+                    if (image->alpha_trait != UndefinedPixelTrait)
                       {
                         pixel=ScaleQuantumToAny(GetPixelAlpha(image,p),
                           max_value);
diff --git a/coders/ps.c b/coders/ps.c
index 06dae20..b11d785 100644
--- a/coders/ps.c
+++ b/coders/ps.c
@@ -1167,7 +1167,7 @@
 {
 #define WriteRunlengthPacket(image,pixel,length,p) \
 { \
-  if ((image->alpha_trait == BlendPixelTrait) && \
+  if ((image->alpha_trait != UndefinedPixelTrait) && \
       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha)) \
     { \
       q=PopHexPixel(hex_digits,0xff,q); \
@@ -2005,7 +2005,7 @@
       }
     else
       if ((image->storage_class == DirectClass) ||
-          (image->colors > 256) || (image->alpha_trait == BlendPixelTrait))
+          (image->colors > 256) || (image->alpha_trait != UndefinedPixelTrait))
         {
           /*
             Dump DirectClass image.
@@ -2090,7 +2090,7 @@
                   break;
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  if ((image->alpha_trait == BlendPixelTrait) &&
+                  if ((image->alpha_trait != UndefinedPixelTrait) &&
                       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
                     {
                       q=PopHexPixel(hex_digits,0xff,q);
diff --git a/coders/ps2.c b/coders/ps2.c
index 4aaa239..83f6aec 100644
--- a/coders/ps2.c
+++ b/coders/ps2.c
@@ -849,7 +849,7 @@
       }
     else
       if ((image->storage_class == DirectClass) || (image->colors > 256) ||
-          (compression == JPEGCompression) || (image->alpha_trait == BlendPixelTrait))
+          (compression == JPEGCompression) || (image->alpha_trait != UndefinedPixelTrait))
         {
           (void) FormatLocaleString(buffer,MaxTextExtent,"%.20g %.20g\n0\n%d\n",
             (double) image->columns,(double) image->rows,(int)
@@ -899,7 +899,7 @@
                   break;
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  if ((image->alpha_trait == BlendPixelTrait) &&
+                  if ((image->alpha_trait != UndefinedPixelTrait) &&
                       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
                     {
                       *q++=ScaleQuantumToChar(QuantumRange);
@@ -953,7 +953,7 @@
                   break;
                 for (x=0; x < (ssize_t) image->columns; x++)
                 {
-                  if ((image->alpha_trait == BlendPixelTrait) &&
+                  if ((image->alpha_trait != UndefinedPixelTrait) &&
                       (GetPixelAlpha(image,p) == (Quantum) TransparentAlpha))
                     {
                       Ascii85Encode(image,ScaleQuantumToChar((Quantum)
diff --git a/coders/ps3.c b/coders/ps3.c
index 35139a7..db2a2d9 100644
--- a/coders/ps3.c
+++ b/coders/ps3.c
@@ -466,7 +466,7 @@
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  assert(image->alpha_trait == BlendPixelTrait);
+  assert(image->alpha_trait != UndefinedPixelTrait);
   status=MagickTrue;
   /*
     Note BeginData DSC comment for update later.
@@ -894,7 +894,7 @@
     case Group4Compression:
     { 
       if ((IsImageMonochrome(image,exception) == MagickFalse) ||
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         compression=RLECompression;
       break;
     }
@@ -1166,7 +1166,7 @@
     /*
       Image mask.
     */
-    if ((image->alpha_trait == BlendPixelTrait) &&
+    if ((image->alpha_trait != UndefinedPixelTrait) &&
         (WritePS3MaskImage(image_info,image,compression,exception) == MagickFalse))
       {
         (void) CloseBlob(image);
@@ -1240,7 +1240,7 @@
     /*
       Masked image?
     */
-    (void) WriteBlobString(image,image->alpha_trait == BlendPixelTrait ?
+    (void) WriteBlobString(image,image->alpha_trait != UndefinedPixelTrait ?
       "true\n" : "false\n");
     /*
       Render with imagemask operator?
diff --git a/coders/psd.c b/coders/psd.c
index 8efc5e8..a4d7d45 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -771,7 +771,7 @@
         if (image->colorspace == CMYKColorspace)
           SetPixelBlack(image,pixel,q);
         else
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             SetPixelAlpha(image,pixel,q);
         break;
       }
@@ -780,7 +780,7 @@
         if ((IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) &&
             (channels > 3))
           break;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           SetPixelAlpha(image,pixel,q);
         break;
       }
@@ -2225,14 +2225,14 @@
           (void) WriteBlobMSBShort(image,1);
           WritePackbitsLength(psd_info,image_info,image,next_image,
             compact_pixels,GrayQuantum,exception);
-          if (next_image->alpha_trait == BlendPixelTrait)
+          if (next_image->alpha_trait != UndefinedPixelTrait)
             WritePackbitsLength(psd_info,image_info,image,next_image,
               compact_pixels,AlphaQuantum,exception);
         }
       WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
         GrayQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
         MagickFalse,exception);
-      if (next_image->alpha_trait == BlendPixelTrait)
+      if (next_image->alpha_trait != UndefinedPixelTrait)
         WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
           AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
           MagickFalse,exception);
@@ -2249,14 +2249,14 @@
             (void) WriteBlobMSBShort(image,1);
             WritePackbitsLength(psd_info,image_info,image,next_image,
               compact_pixels,IndexQuantum,exception);
-            if (next_image->alpha_trait == BlendPixelTrait)
+            if (next_image->alpha_trait != UndefinedPixelTrait)
               WritePackbitsLength(psd_info,image_info,image,next_image,
                 compact_pixels,AlphaQuantum,exception);
           }
         WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
           IndexQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
           MagickFalse,exception);
-        if (next_image->alpha_trait == BlendPixelTrait)
+        if (next_image->alpha_trait != UndefinedPixelTrait)
           WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
             AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
             MagickFalse,exception);
@@ -2281,7 +2281,7 @@
             if (next_image->colorspace == CMYKColorspace)
               WritePackbitsLength(psd_info,image_info,image,next_image,
                 compact_pixels,BlackQuantum,exception);
-            if (next_image->alpha_trait == BlendPixelTrait)
+            if (next_image->alpha_trait != UndefinedPixelTrait)
               WritePackbitsLength(psd_info,image_info,image,next_image,
                 compact_pixels,AlphaQuantum,exception);
           }
@@ -2303,7 +2303,7 @@
             BlackQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
             MagickFalse,exception);
         (void) SetImageProgress(image,SaveImagesTag,4,6);
-        if (next_image->alpha_trait == BlendPixelTrait)
+        if (next_image->alpha_trait != UndefinedPixelTrait)
           WriteOneChannel(psd_info,image_info,image,next_image,compact_pixels,
             AlphaQuantum,(i++ == 0) || (separate != MagickFalse) ? MagickTrue :
             MagickFalse,exception);
@@ -2521,7 +2521,7 @@
   if (status == MagickFalse)
     return(status);
   packet_size=(size_t) (image->depth > 8 ? 6 : 3);
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     packet_size+=image->depth > 8 ? 2 : 1;
   psd_info.version=1;
   if ((LocaleCompare(image_info->magick,"PSB") == 0) ||
@@ -2532,16 +2532,16 @@
   for (i=1; i <= 6; i++)
     (void) WriteBlobByte(image, 0);  /* 6 bytes of reserved */
   if (IsImageGray(image,exception) != MagickFalse)
-    num_channels=(image->alpha_trait == BlendPixelTrait ? 2UL : 1UL);
+    num_channels=(image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL);
   else
     if (image->storage_class == PseudoClass)
-      num_channels=(image->alpha_trait == BlendPixelTrait ? 2UL : 1UL);
+      num_channels=(image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL);
     else
       {
         if (image->colorspace != CMYKColorspace)
-          num_channels=(image->alpha_trait == BlendPixelTrait ? 4UL : 3UL);
+          num_channels=(image->alpha_trait != UndefinedPixelTrait ? 4UL : 3UL);
         else
-          num_channels=(image->alpha_trait == BlendPixelTrait ? 5UL : 4UL);
+          num_channels=(image->alpha_trait != UndefinedPixelTrait ? 5UL : 4UL);
       }
   (void) WriteBlobMSBShort(image,(unsigned short) num_channels);
   (void) WriteBlobMSBLong(image,(unsigned int) image->rows);
@@ -2644,22 +2644,22 @@
   layer_count=0;
   layer_info_size=2;
   base_image=GetNextImageInList(image);
-  if ((image->alpha_trait == BlendPixelTrait) && (base_image == (Image *) NULL))
+  if ((image->alpha_trait != UndefinedPixelTrait) && (base_image == (Image *) NULL))
     base_image=image;
   next_image=base_image;
   while ( next_image != NULL )
   {
     packet_size=next_image->depth > 8 ? 2UL : 1UL;
     if (IsImageGray(next_image,exception) != MagickFalse)
-      num_channels=next_image->alpha_trait == BlendPixelTrait ? 2UL : 1UL;
+      num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL;
     else
       if (next_image->storage_class == PseudoClass)
-        num_channels=next_image->alpha_trait == BlendPixelTrait ? 2UL : 1UL;
+        num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 2UL : 1UL;
       else
         if (next_image->colorspace != CMYKColorspace)
-          num_channels=next_image->alpha_trait == BlendPixelTrait ? 4UL : 3UL;
+          num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 4UL : 3UL;
         else
-          num_channels=next_image->alpha_trait == BlendPixelTrait ? 5UL : 4UL;
+          num_channels=next_image->alpha_trait != UndefinedPixelTrait ? 5UL : 4UL;
     channelLength=(size_t) (next_image->columns*next_image->rows*packet_size+2);
     layer_info_size+=(size_t) (4*4+2+num_channels*6+(psd_info.version == 1 ? 8 :
       16)+4*1+4+num_channels*channelLength);
@@ -2691,7 +2691,7 @@
       else
         rounded_layer_info_size=layer_info_size;
       (void) SetPSDSize(&psd_info,image,rounded_layer_info_size);
-      if (base_image->alpha_trait == BlendPixelTrait)
+      if (base_image->alpha_trait != UndefinedPixelTrait)
         (void) WriteBlobMSBShort(image,-(unsigned short) layer_count);
       else
         (void) WriteBlobMSBShort(image,(unsigned short) layer_count);
@@ -2713,10 +2713,10 @@
             (next_image->storage_class == PseudoClass))
           {
              (void) WriteBlobMSBShort(image,(unsigned short)
-               (next_image->alpha_trait == BlendPixelTrait ? 2 : 1));
+               (next_image->alpha_trait != UndefinedPixelTrait ? 2 : 1));
              (void) WriteBlobMSBShort(image,0);
              (void) SetPSDSize(&psd_info,image,channel_size);
-             if (next_image->alpha_trait == BlendPixelTrait)
+             if (next_image->alpha_trait != UndefinedPixelTrait)
                {
                  (void) WriteBlobMSBShort(image,(unsigned short) -1);
                  (void) SetPSDSize(&psd_info,image,channel_size);
@@ -2726,14 +2726,14 @@
             if (next_image->colorspace != CMYKColorspace)
               {
                 (void) WriteBlobMSBShort(image,(unsigned short)
-                  (next_image->alpha_trait == BlendPixelTrait ? 4 : 3));
+                  (next_image->alpha_trait != UndefinedPixelTrait ? 4 : 3));
                (void) WriteBlobMSBShort(image,0);
                (void) SetPSDSize(&psd_info,image,channel_size);
                (void) WriteBlobMSBShort(image,1);
                (void) SetPSDSize(&psd_info,image,channel_size);
                (void) WriteBlobMSBShort(image,2);
                (void) SetPSDSize(&psd_info,image,channel_size);
-               if (next_image->alpha_trait == BlendPixelTrait)
+               if (next_image->alpha_trait != UndefinedPixelTrait)
                  {
                    (void) WriteBlobMSBShort(image,(unsigned short) -1);
                    (void) SetPSDSize(&psd_info,image,channel_size);
diff --git a/coders/rgb.c b/coders/rgb.c
index 1edfa5d..8bafb52 100644
--- a/coders/rgb.c
+++ b/coders/rgb.c
@@ -258,7 +258,7 @@
                 SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -315,7 +315,7 @@
                 "UnexpectedEndOfFile",image->filename);
               break;
             }
-          for (i=0; i < (ssize_t) (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
+          for (i=0; i < (ssize_t) (image->alpha_trait != UndefinedPixelTrait ? 4 : 3); i++)
           {
             quantum_type=quantum_types[i];
             q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
@@ -554,7 +554,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -834,7 +834,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1114,7 +1114,7 @@
     */
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
     if ((LocaleCompare(image_info->magick,"RGBA") == 0) &&
-        (image->alpha_trait != BlendPixelTrait))
+        (image->alpha_trait == UndefinedPixelTrait))
       (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)
diff --git a/coders/rle.c b/coders/rle.c
index 867488a..9479838 100644
--- a/coders/rle.c
+++ b/coders/rle.c
@@ -307,7 +307,7 @@
     /*
       Allocate RLE pixels.
     */
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       number_planes++;
     number_pixels=(MagickSizeType) image->columns*image->rows;
     if ((number_pixels*number_planes) != (size_t) (number_pixels*number_planes))
@@ -328,7 +328,7 @@
         p=pixels;
         for (i=0; i < (ssize_t) number_pixels; i++)
         {
-          if (image->alpha_trait != BlendPixelTrait)
+          if (image->alpha_trait == UndefinedPixelTrait)
             for (j=0; j < (ssize_t) number_planes; j++)
               *p++=background_color[j];
           else
@@ -488,7 +488,7 @@
             SetPixelRed(image,ScaleCharToQuantum(*p++),q);
             SetPixelGreen(image,ScaleCharToQuantum(*p++),q);
             SetPixelBlue(image,ScaleCharToQuantum(*p++),q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
             q+=GetPixelChannels(image);
           }
@@ -539,7 +539,7 @@
               p++;
             }
         p=pixels;
-        if (image->alpha_trait != BlendPixelTrait)
+        if (image->alpha_trait == UndefinedPixelTrait)
           {
             /*
               Convert raster image to PseudoClass pixel packets.
diff --git a/coders/sgi.c b/coders/sgi.c
index 4da27dc..d9d0f8a 100644
--- a/coders/sgi.c
+++ b/coders/sgi.c
@@ -578,7 +578,7 @@
                 SetPixelBlue(image,ScaleShortToQuantum((unsigned short)
                   ((*(p+4) << 8) | (*(p+5)))),q);
                 SetPixelAlpha(image,OpaqueAlpha,q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,ScaleShortToQuantum((unsigned short)
                     ((*(p+6) << 8) | (*(p+7)))),q);
                 p+=8;
@@ -608,7 +608,7 @@
               SetPixelGreen(image,ScaleCharToQuantum(*(p+1)),q);
               SetPixelBlue(image,ScaleCharToQuantum(*(p+2)),q);
               SetPixelAlpha(image,OpaqueAlpha,q);
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 SetPixelAlpha(image,ScaleCharToQuantum(*(p+3)),q);
               p+=4;
               q+=GetPixelChannels(image);
@@ -946,7 +946,7 @@
     iris_info.dimension=3;
     iris_info.columns=(unsigned short) image->columns;
     iris_info.rows=(unsigned short) image->rows;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       iris_info.depth=4;
     else
       {
diff --git a/coders/sixel.c b/coders/sixel.c
index 7a9b744..cc19b95 100644
--- a/coders/sixel.c
+++ b/coders/sixel.c
@@ -1214,7 +1214,7 @@
   if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
   opacity=(-1);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       if ((image->storage_class == DirectClass) || (image->colors > 256))
         (void) SetImageType(image,PaletteType,exception);
diff --git a/coders/sun.c b/coders/sun.c
index 2715795..3fb0b77 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -539,7 +539,7 @@
             bytes_per_pixel;
 
           bytes_per_pixel=3;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             bytes_per_pixel++;
           if (bytes_per_line == 0)
             bytes_per_line=bytes_per_pixel*image->columns;
@@ -555,7 +555,7 @@
               break;
             for (x=0; x < (ssize_t) image->columns; x++)
             {
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 SetPixelAlpha(image,ScaleCharToQuantum(*p++),q);
               if (sun_info.type == RT_STANDARD)
                 {
@@ -810,9 +810,9 @@
         /*
           Full color SUN raster.
         */
-        sun_info.depth=(unsigned int) image->alpha_trait == BlendPixelTrait ?
+        sun_info.depth=(unsigned int) image->alpha_trait != UndefinedPixelTrait ?
           32U : 24U;
-        sun_info.length=(unsigned int) ((image->alpha_trait == BlendPixelTrait ?
+        sun_info.length=(unsigned int) ((image->alpha_trait != UndefinedPixelTrait ?
           4 : 3)*number_pixels);
         sun_info.length+=sun_info.length & 0x01 ? (unsigned int) image->rows :
           0;
@@ -873,7 +873,7 @@
           Allocate memory for pixels.
         */
         bytes_per_pixel=3;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           bytes_per_pixel++;
         length=image->columns;
         pixels=(unsigned char *) AcquireQuantumMemory(length,4*sizeof(*pixels));
@@ -890,7 +890,7 @@
           q=pixels;
           for (x=0; x < (ssize_t) image->columns; x++)
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               *q++=ScaleQuantumToChar(GetPixelAlpha(image,p));
             *q++=ScaleQuantumToChar(GetPixelRed(image,p));
             *q++=ScaleQuantumToChar(GetPixelGreen(image,p));
diff --git a/coders/tga.c b/coders/tga.c
index d2ebcd0..4f81fa7 100644
--- a/coders/tga.c
+++ b/coders/tga.c
@@ -466,7 +466,7 @@
             pixel.green=(MagickRealType) ScaleAnyToQuantum((1UL*(k & 0x03)
               << 3)+(1UL*(j & 0xe0) >> 5),range);
             pixel.blue=(MagickRealType) ScaleAnyToQuantum(1UL*(j & 0x1f),range);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               pixel.alpha=(MagickRealType) ((k & 0x80) == 0 ? (Quantum)
                 OpaqueAlpha : (Quantum) TransparentAlpha); 
             if (image->storage_class == PseudoClass)
@@ -506,7 +506,7 @@
       SetPixelRed(image,ClampToQuantum(pixel.red),q);
       SetPixelGreen(image,ClampToQuantum(pixel.green),q);
       SetPixelBlue(image,ClampToQuantum(pixel.blue),q);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
       q+=GetPixelChannels(image);
     }
@@ -680,7 +680,7 @@
             value=((unsigned char) ScaleQuantumToAny(ClampToQuantum(
               GetPixelBlue(image,p)),range)) | ((green & 0x07) << 5);
             (void) WriteBlobByte(image,value);
-            value=(((image->alpha_trait == BlendPixelTrait) && (ClampToQuantum(
+            value=(((image->alpha_trait != UndefinedPixelTrait) && (ClampToQuantum(
               GetPixelAlpha(image,p)) < midpoint)) ? 80 : 0) |
               ((unsigned char) ScaleQuantumToAny(ClampToQuantum(
               GetPixelRed(image,p)),range) << 2) | ((green & 0x18) >> 3);
@@ -693,7 +693,7 @@
           (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelGreen(image,
             p)));
           (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelRed(image,p)));
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             (void) WriteBlobByte(image,ScaleQuantumToChar(GetPixelAlpha(image,
               p)));
         }
@@ -781,7 +781,7 @@
   if ((image_info->type != TrueColorType) &&
       (image_info->type != TrueColorMatteType) &&
       (image_info->type != PaletteType) &&
-      (image->alpha_trait != BlendPixelTrait) &&
+      (image->alpha_trait == UndefinedPixelTrait) &&
       (IsImageGray(image,exception) != MagickFalse))
     tga_info.image_type=compression == RLECompression ? TGARLEMonochrome :
       TGAMonochrome;
@@ -798,7 +798,7 @@
         else
           {
             tga_info.bits_per_pixel=24;
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 tga_info.bits_per_pixel=32;
                 tga_info.attributes=8;  /* # of alpha bits */
@@ -860,7 +860,7 @@
               image->colormap[i].green),range);
             *q++=((unsigned char) ScaleQuantumToAny(ClampToQuantum(
               image->colormap[i].blue),range)) | ((green & 0x07) << 5);
-            *q++=(((image->alpha_trait == BlendPixelTrait) && (ClampToQuantum(
+            *q++=(((image->alpha_trait != UndefinedPixelTrait) && (ClampToQuantum(
               image->colormap[i].alpha) < midpoint)) ? 80 : 0) |
               ((unsigned char) ScaleQuantumToAny(ClampToQuantum(
               image->colormap[i].red),range) << 2) | ((green & 0x18) >> 3);
@@ -916,7 +916,7 @@
                     (GetPixelRed(image,p+(i*channels)) !=
                      GetPixelRed(image,p+((i-1)*channels))))
                   break;
-                if ((image->alpha_trait == BlendPixelTrait) &&
+                if ((image->alpha_trait != UndefinedPixelTrait) &&
                     (GetPixelAlpha(image,p+(i*channels)) !=
                      GetPixelAlpha(image,p+(i-1)*channels)))
                   break;
diff --git a/coders/thumbnail.c b/coders/thumbnail.c
index 80d7cbd..c04802c 100644
--- a/coders/thumbnail.c
+++ b/coders/thumbnail.c
@@ -205,7 +205,7 @@
     length,exception);
   if (thumbnail_image == (Image *) NULL)
     return(MagickFalse);
-  (void) SetImageType(thumbnail_image,thumbnail_image->alpha_trait != BlendPixelTrait ?
+  (void) SetImageType(thumbnail_image,thumbnail_image->alpha_trait == UndefinedPixelTrait ?
     TrueColorType : TrueColorMatteType,exception);
   (void) CopyMagickString(thumbnail_image->filename,image->filename,
     MaxTextExtent);
diff --git a/coders/tiff.c b/coders/tiff.c
index b874bc4..b675e3a 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -1503,7 +1503,7 @@
           }
         quantum_type=IndexQuantum;
         pad=(size_t) MagickMax((size_t) samples_per_pixel-1,0);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             if (image->storage_class != PseudoClass)
               {
@@ -1565,7 +1565,7 @@
         */
         pad=(size_t) MagickMax((size_t) samples_per_pixel-3,0);
         quantum_type=RGBQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             quantum_type=RGBAQuantum;
             pad=(size_t) MagickMax((size_t) samples_per_pixel-4,0);
@@ -1574,7 +1574,7 @@
           {
             pad=(size_t) MagickMax((size_t) samples_per_pixel-4,0);
             quantum_type=CMYKQuantum;
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 quantum_type=CMYKAQuantum;
                 pad=(size_t) MagickMax((size_t) samples_per_pixel-5,0);
@@ -1758,7 +1758,7 @@
               (TIFFGetG(*p))),q);
             SetPixelBlue(image,ScaleCharToQuantum((unsigned char)
               (TIFFGetB(*p))),q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum((unsigned char)
                 (TIFFGetA(*p))),q);
             p++;
@@ -1843,7 +1843,7 @@
               x);
             for (row=rows_remaining; row > 0; row--)
             {
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 for (column=columns_remaining; column > 0; column--)
                 {
                   SetPixelRed(image,ScaleCharToQuantum((unsigned char)
@@ -1941,7 +1941,7 @@
               TIFFGetG(*p)),q);
             SetPixelBlue(image,ScaleCharToQuantum((unsigned char) TIFFGetB(*p)),
               q);
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               SetPixelAlpha(image,ScaleCharToQuantum((unsigned char)
                 TIFFGetA(*p)),q);
             p--;
@@ -3235,7 +3235,7 @@
                   PHOTOMETRIC_MINISBLACK);
                 (void) TIFFSetField(tiff,TIFFTAG_SAMPLESPERPIXEL,1);
                 if ((image_info->depth == 0) &&
-                    (image->alpha_trait != BlendPixelTrait) &&
+                    (image->alpha_trait == UndefinedPixelTrait) &&
                     (IsImageMonochrome(image,exception) != MagickFalse))
                   {
                     status=SetQuantumDepth(image,quantum_info,1);
@@ -3290,7 +3290,7 @@
     (void) TIFFSetField(tiff,TIFFTAG_COMPRESSION,compress_tag);
     (void) TIFFSetField(tiff,TIFFTAG_FILLORDER,endian);
     (void) TIFFSetField(tiff,TIFFTAG_BITSPERSAMPLE,quantum_info->depth);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       {
         uint16
           extra_samples,
@@ -3569,7 +3569,7 @@
           default:
           {
             quantum_type=RGBQuantum;
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               quantum_type=RGBAQuantum;
             for (y=0; y < (ssize_t) image->rows; y++)
             {
@@ -3657,7 +3657,7 @@
                 if (status == MagickFalse)
                   break;
               }
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               for (y=0; y < (ssize_t) image->rows; y++)
               {
                 register const Quantum
@@ -3688,7 +3688,7 @@
           CMYK TIFF image.
         */
         quantum_type=CMYKQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           quantum_type=CMYKAQuantum;
         if (image->colorspace != CMYKColorspace)
           (void) TransformImageColorspace(image,CMYKColorspace,exception);
@@ -3753,7 +3753,7 @@
           Convert PseudoClass packets to contiguous grayscale scanlines.
         */
         quantum_type=IndexQuantum;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             if (photometric != PHOTOMETRIC_PALETTE)
               quantum_type=GrayAlphaQuantum;
diff --git a/coders/tile.c b/coders/tile.c
index 0341a56..cf4ff77 100644
--- a/coders/tile.c
+++ b/coders/tile.c
@@ -124,7 +124,7 @@
     return(DestroyImageList(image));
   image->colorspace=tile_image->colorspace;
   image->alpha_trait=tile_image->alpha_trait;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     (void) SetImageBackgroundColor(image,exception);
   (void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);
   if (LocaleCompare(tile_image->magick,"PATTERN") == 0)
diff --git a/coders/txt.c b/coders/txt.c
index 7c4afdb..0e5b539 100644
--- a/coders/txt.c
+++ b/coders/txt.c
@@ -476,7 +476,7 @@
         {
           case GRAYColorspace:
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 count=(ssize_t) sscanf(text,"%ld,%ld: (%lf%*[%,]%lf%*[%,]",
                   &x_offset,&y_offset,&red,&alpha);
@@ -492,7 +492,7 @@
           }
           case CMYKColorspace:
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 count=(ssize_t) sscanf(text,
                   "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]",
@@ -506,7 +506,7 @@
           }
           default:
           {
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               {
                 count=(ssize_t) sscanf(text,
                   "%ld,%ld: (%lf%*[%,]%lf%*[%,]%lf%*[%,]%lf%*[%,]",
@@ -722,7 +722,7 @@
       MagickColorspaceOptions,(ssize_t) image->colorspace),MaxTextExtent);
     LocaleLower(colorspace);
     image->depth=GetImageQuantumDepth(image,MagickTrue);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       (void) ConcatenateMagickString(colorspace,"a",MaxTextExtent);
     compliance=NoCompliance;
     if (LocaleCompare(image_info->magick,"SPARSE-COLOR") != 0)
@@ -787,7 +787,7 @@
             ConcatenateColorComponent(&pixel,BlackPixelChannel,compliance,
               tuple);
           }
-        if (pixel.alpha_trait == BlendPixelTrait)
+        if (pixel.alpha_trait != UndefinedPixelTrait)
           {
             (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
             ConcatenateColorComponent(&pixel,AlphaPixelChannel,compliance,
diff --git a/coders/uil.c b/coders/uil.c
index 950b541..9f71ac3 100644
--- a/coders/uil.c
+++ b/coders/uil.c
@@ -229,7 +229,7 @@
         Convert DirectClass to PseudoClass image.
       */
       matte_image=(unsigned char *) NULL;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           /*
             Map all the transparent pixels.
diff --git a/coders/viff.c b/coders/viff.c
index 4ed285c..85d93e3 100644
--- a/coders/viff.c
+++ b/coders/viff.c
@@ -691,7 +691,7 @@
                   SetPixelBlue(image,image->colormap[
                     ConstrainColormapIndex(image,index,exception)].blue,q);
                 }
-              SetPixelAlpha(image,image->alpha_trait == BlendPixelTrait ?
+              SetPixelAlpha(image,image->alpha_trait != UndefinedPixelTrait ?
                 ScaleCharToQuantum(*(p+number_pixels*3)) : OpaqueAlpha,q);
               p++;
               q+=GetPixelChannels(image);
@@ -1094,7 +1094,7 @@
             *q=ScaleQuantumToChar(GetPixelRed(image,p));
             *(q+number_pixels)=ScaleQuantumToChar(GetPixelGreen(image,p));
             *(q+number_pixels*2)=ScaleQuantumToChar(GetPixelBlue(image,p));
-            if (image->alpha_trait == BlendPixelTrait)
+            if (image->alpha_trait != UndefinedPixelTrait)
               *(q+number_pixels*3)=ScaleQuantumToChar((Quantum)
                 (GetPixelAlpha(image,p)));
             p+=GetPixelChannels(image);
diff --git a/coders/vips.c b/coders/vips.c
index aebab80..299efee 100644
--- a/coders/vips.c
+++ b/coders/vips.c
@@ -651,11 +651,11 @@
   (void) WriteBlobLong(image,(unsigned int) image->columns);
   (void) WriteBlobLong(image,(unsigned int) image->rows);
   (void) SetImageStorageClass(image,DirectClass,exception);
-  channels=image->alpha_trait == BlendPixelTrait ? 4 : 3;
+  channels=image->alpha_trait != UndefinedPixelTrait ? 4 : 3;
   if (IsImageGray(image,exception) != MagickFalse)
-    channels=image->alpha_trait == BlendPixelTrait ? 2 : 1;
+    channels=image->alpha_trait != UndefinedPixelTrait ? 2 : 1;
   else if (image->colorspace == CMYKColorspace)
-    channels=image->alpha_trait == BlendPixelTrait ? 5 : 4;
+    channels=image->alpha_trait != UndefinedPixelTrait ? 5 : 4;
   (void) WriteBlobLong(image,channels);
   (void) WriteBlobLong(image,0);
   if (image->depth == 16)
diff --git a/coders/webp.c b/coders/webp.c
index edbd913..6c667c6 100644
--- a/coders/webp.c
+++ b/coders/webp.c
@@ -670,7 +670,7 @@
       break;
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      *q++=(uint32_t) (image->alpha_trait == BlendPixelTrait ?
+      *q++=(uint32_t) (image->alpha_trait != UndefinedPixelTrait ?
         ScaleQuantumToChar(GetPixelAlpha(image,p)) << 24 : 0xff000000) |
         (ScaleQuantumToChar(GetPixelRed(image,p)) << 16) |
         (ScaleQuantumToChar(GetPixelGreen(image,p)) << 8) |
diff --git a/coders/xpm.c b/coders/xpm.c
index bdbb514..f2e8e36 100644
--- a/coders/xpm.c
+++ b/coders/xpm.c
@@ -691,7 +691,7 @@
   if (picon->storage_class == PseudoClass)
     {
       (void) CompressImageColormap(picon,exception);
-      if (picon->alpha_trait == BlendPixelTrait)
+      if (picon->alpha_trait != UndefinedPixelTrait)
         transparent=MagickTrue;
     }
   else
@@ -699,7 +699,7 @@
       /*
         Convert DirectClass to PseudoClass picon.
       */
-      if (picon->alpha_trait == BlendPixelTrait)
+      if (picon->alpha_trait != UndefinedPixelTrait)
         {
           /*
             Map all the transparent pixels.
@@ -915,7 +915,7 @@
   if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
   opacity=(-1);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       if ((image->storage_class == DirectClass) || (image->colors > 256))
         (void) SetImageType(image,PaletteType,exception);
diff --git a/coders/ycbcr.c b/coders/ycbcr.c
index af7cf6c..5745da5 100644
--- a/coders/ycbcr.c
+++ b/coders/ycbcr.c
@@ -255,7 +255,7 @@
                 SetPixelRed(image,GetPixelRed(canvas_image,p),q);
                 SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
                 SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   SetPixelAlpha(image,GetPixelAlpha(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
@@ -295,7 +295,7 @@
           }
         for (y=0; y < (ssize_t) image->extract_info.height; y++)
         {
-          for (i=0; i < (image->alpha_trait == BlendPixelTrait ? 4 : 3); i++)
+          for (i=0; i < (image->alpha_trait != UndefinedPixelTrait ? 4 : 3); i++)
           {
             if (count != (ssize_t) length)
               {
@@ -506,7 +506,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)
             {
@@ -754,7 +754,7 @@
             if (status == MagickFalse)
               break;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             (void) CloseBlob(image);
             AppendImageFormat("A",image->filename);
@@ -1024,7 +1024,7 @@
     if (image->colorspace != YCbCrColorspace)
       (void) TransformImageColorspace(image,YCbCrColorspace,exception);
     if ((LocaleCompare(image_info->magick,"YCbCrA") == 0) &&
-        (image->alpha_trait != BlendPixelTrait))
+        (image->alpha_trait == UndefinedPixelTrait))
       (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)