diff --git a/MagickCore/accelerate.c b/MagickCore/accelerate.c
index ac37294..96adf73 100644
--- a/MagickCore/accelerate.c
+++ b/MagickCore/accelerate.c
@@ -455,7 +455,7 @@
     filterHeight = (unsigned int) kernel->height;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterWidth);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterHeight);
-    matte = (image->alpha_trait != BlendPixelTrait)?1:0;
+    matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&matte);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(ChannelType),(void *)&channel);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++, (localGroupSize[0] + kernel->width-1)*(localGroupSize[1] + kernel->height-1)*sizeof(CLPixelPacket),NULL);
@@ -501,7 +501,7 @@
     filterHeight = (unsigned int) kernel->height;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterWidth);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&filterHeight);
-    matte = (image->alpha_trait != BlendPixelTrait)?1:0;
+    matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(unsigned int),(void *)&matte);
     clStatus|=clEnv->library->clSetKernelArg(clkernel,i++,sizeof(ChannelType),(void *)&channel);
     if (clStatus != CL_SUCCESS)
@@ -1844,7 +1844,7 @@
   clStatus|=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(cl_float4), &biasPixel);
   clStatus|=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(ChannelType), &channel);
 
-  matte = (image->alpha_trait != BlendPixelTrait)?1:0;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
   clStatus|=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(unsigned int), &matte);
 
   clStatus=clEnv->library->clSetKernelArg(rotationalBlurKernel,i++,sizeof(cl_float2), &blurCenter);
@@ -3660,14 +3660,14 @@
       goto cleanup;
     }
     
-    status = resizeHorizontalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait != BlendPixelTrait)?1:0
+    status = resizeHorizontalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait == UndefinedPixelTrait)?1:0
           , tempImageBuffer, (unsigned int) resizedColumns, (unsigned int) image->rows
           , resizeFilter, cubicCoefficientsBuffer
           , xFactor, clEnv, queue, exception);
     if (status != MagickTrue)
       goto cleanup;
     
-    status = resizeVerticalFilter(tempImageBuffer, (unsigned int) resizedColumns, (unsigned int) image->rows, (image->alpha_trait != BlendPixelTrait)?1:0
+    status = resizeVerticalFilter(tempImageBuffer, (unsigned int) resizedColumns, (unsigned int) image->rows, (image->alpha_trait == UndefinedPixelTrait)?1:0
        , filteredImageBuffer, (unsigned int) resizedColumns, (unsigned int) resizedRows
        , resizeFilter, cubicCoefficientsBuffer
        , yFactor, clEnv, queue, exception);
@@ -3684,14 +3684,14 @@
       goto cleanup;
     }
 
-    status = resizeVerticalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait != BlendPixelTrait)?1:0
+    status = resizeVerticalFilter(imageBuffer, (unsigned int) image->columns, (unsigned int) image->rows, (image->alpha_trait == UndefinedPixelTrait)?1:0
        , tempImageBuffer, (unsigned int) image->columns, (unsigned int) resizedRows
        , resizeFilter, cubicCoefficientsBuffer
        , yFactor, clEnv, queue, exception);
     if (status != MagickTrue)
       goto cleanup;
 
-    status = resizeHorizontalFilter(tempImageBuffer, (unsigned int) image->columns, (unsigned int) resizedRows, (image->alpha_trait != BlendPixelTrait)?1:0
+    status = resizeHorizontalFilter(tempImageBuffer, (unsigned int) image->columns, (unsigned int) resizedRows, (image->alpha_trait == UndefinedPixelTrait)?1:0
        , filteredImageBuffer, (unsigned int) resizedColumns, (unsigned int) resizedRows
        , resizeFilter, cubicCoefficientsBuffer
        , xFactor, clEnv, queue, exception);
@@ -5769,7 +5769,7 @@
   clStatus |=clEnv->library->clSetKernelArg(hullPass1,2,sizeof(unsigned int),(void *)&imageWidth);
   imageHeight = (unsigned int) image->rows;
   clStatus |=clEnv->library->clSetKernelArg(hullPass1,3,sizeof(unsigned int),(void *)&imageHeight);
-  matte = (image->alpha_trait != BlendPixelTrait)?0:1;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?0:1;
   clStatus |=clEnv->library->clSetKernelArg(hullPass1,6,sizeof(int),(void *)&matte);
   if (clStatus != CL_SUCCESS)
   {
@@ -5783,7 +5783,7 @@
   clStatus |=clEnv->library->clSetKernelArg(hullPass2,2,sizeof(unsigned int),(void *)&imageWidth);
   imageHeight = (unsigned int) image->rows;
   clStatus |=clEnv->library->clSetKernelArg(hullPass2,3,sizeof(unsigned int),(void *)&imageHeight);
-  matte = (image->alpha_trait != BlendPixelTrait)?0:1;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?0:1;
   clStatus |=clEnv->library->clSetKernelArg(hullPass2,6,sizeof(int),(void *)&matte);
   if (clStatus != CL_SUCCESS)
   {
@@ -6723,7 +6723,7 @@
   clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(cl_float4), &biasPixel);
 
   clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(ChannelType), &channel);
-  matte = (image->alpha_trait != BlendPixelTrait)?1:0;
+  matte = (image->alpha_trait == UndefinedPixelTrait)?1:0;
   clStatus|=clEnv->library->clSetKernelArg(motionBlurKernel,i++,sizeof(unsigned int), &matte);
   if (clStatus != CL_SUCCESS)
   {
@@ -6991,7 +6991,7 @@
   status = LaunchCompositeKernel(clEnv,queue,imageBuffer,
            (unsigned int) image->columns,
            (unsigned int) image->rows,
-           (unsigned int) (image->alpha_trait != BlendPixelTrait) ? 1 : 0,
+           (unsigned int) (image->alpha_trait == UndefinedPixelTrait) ? 1 : 0,
            channel, compose, compositeImageBuffer,
            (unsigned int) compositeImage->columns,
            (unsigned int) compositeImage->rows,
diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c
index b65cfe7..378b994 100644
--- a/MagickCore/annotate.c
+++ b/MagickCore/annotate.c
@@ -1318,7 +1318,7 @@
     {
       if (image->storage_class != DirectClass)
         (void) SetImageStorageClass(image,DirectClass,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
     }
   direction=1.0;
@@ -1845,9 +1845,9 @@
       /*
         Render fill color.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
-      if (annotate_image->alpha_trait != BlendPixelTrait)
+      if (annotate_image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(annotate_image,OpaqueAlphaChannel,
           exception);
       fill_color=draw_info->fill;
diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c
index a03b45b..75f8d4f 100644
--- a/MagickCore/attribute.c
+++ b/MagickCore/attribute.c
@@ -305,7 +305,7 @@
   status=MagickTrue;
   for (i=0; i < (ssize_t) number_threads; i++)
     current_depth[i]=1;
-  if ((image->storage_class == PseudoClass) && (image->alpha_trait != BlendPixelTrait))
+  if ((image->storage_class == PseudoClass) && (image->alpha_trait == UndefinedPixelTrait))
     {
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
       #pragma omp parallel for schedule(static,4) shared(status) \
@@ -604,7 +604,7 @@
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (image->colorspace == CMYKColorspace)
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         return(ColorSeparationType);
       return(ColorSeparationMatteType);
     }
@@ -612,17 +612,17 @@
     return(BilevelType);
   if (IsImageGray(image,exception) != MagickFalse)
     {
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         return(GrayscaleMatteType);
       return(GrayscaleType);
     }
   if (IsPaletteImage(image,exception) != MagickFalse)
     {
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         return(PaletteMatteType);
       return(PaletteType);
     }
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     return(TrueColorMatteType);
   return(TrueColorType);
 }
@@ -710,7 +710,7 @@
   if (SyncImagePixelCache((Image *) image,exception) == MagickFalse)
     return(MagickFalse);
   ((Image *) image)->type=type;
-  if ((type == GrayscaleType) && (image->alpha_trait == BlendPixelTrait))
+  if ((type == GrayscaleType) && (image->alpha_trait != UndefinedPixelTrait))
     ((Image *) image)->type=GrayscaleMatteType;
   return(MagickTrue);
 }
@@ -848,7 +848,7 @@
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     return(MagickTrue);
   image_view=AcquireVirtualCacheView(image,exception);
   for (y=0; y < (ssize_t) image->rows; y++)
@@ -1193,7 +1193,7 @@
     {
       if (IsImageGray(image,exception) == MagickFalse)
         status=TransformImageColorspace(image,GRAYColorspace,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       break;
     }
@@ -1218,7 +1218,7 @@
 
       if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
         status=TransformImageColorspace(image,sRGBColorspace,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       channel_mask=SetImageChannelMask(image,AlphaChannel);
       (void) BilevelImage(image,(double) QuantumRange/2.0,exception);
@@ -1232,7 +1232,7 @@
     {
       if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
         status=TransformImageColorspace(image,sRGBColorspace,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       quantize_info=AcquireQuantizeInfo(image_info);
       quantize_info->colorspace=TransparentColorspace;
@@ -1255,7 +1255,7 @@
         status=TransformImageColorspace(image,sRGBColorspace,exception);
       if (image->storage_class != DirectClass)
         status=SetImageStorageClass(image,DirectClass,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       break;
     }
@@ -1282,7 +1282,7 @@
         }
       if (image->storage_class != DirectClass)
         status=SetImageStorageClass(image,DirectClass,exception);
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         status=SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       break;
     }
diff --git a/MagickCore/cache.c b/MagickCore/cache.c
index a1451a8..d23c53f 100644
--- a/MagickCore/cache.c
+++ b/MagickCore/cache.c
@@ -4706,8 +4706,8 @@
     {
       case BackgroundVirtualPixelMethod:
       {
-        if ((image->background_color.alpha_trait == BlendPixelTrait) &&
-            (image->alpha_trait != BlendPixelTrait))
+        if ((image->background_color.alpha_trait != UndefinedPixelTrait) &&
+            (image->alpha_trait == UndefinedPixelTrait))
           (void) SetCacheAlphaChannel(image,OpaqueAlpha,exception);
         if ((IsPixelInfoGray(&image->background_color) == MagickFalse) &&
             (IsGrayColorspace(image->colorspace) != MagickFalse))
@@ -4716,7 +4716,7 @@
       }
       case TransparentVirtualPixelMethod:
       {
-        if (image->alpha_trait != BlendPixelTrait)
+        if (image->alpha_trait == UndefinedPixelTrait)
           (void) SetCacheAlphaChannel(image,OpaqueAlpha,exception);
         break;
       }
diff --git a/MagickCore/channel.c b/MagickCore/channel.c
index 442a026..8250fa5 100644
--- a/MagickCore/channel.c
+++ b/MagickCore/channel.c
@@ -626,7 +626,7 @@
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
   assert(image->signature == MagickSignature);
-  return(image->alpha_trait == BlendPixelTrait ? MagickTrue : MagickFalse);
+  return(image->alpha_trait != UndefinedPixelTrait ? MagickTrue : MagickFalse);
 }
 
 /*
@@ -858,8 +858,9 @@
 %
 %    o alpha_type:  The alpha channel type: ActivateAlphaChannel,
 %      AssociateAlphaChannel, CopyAlphaChannel, DeactivateAlphaChannel,
-%      DisassociateAlphaChannel,  ExtractAlphaChannel, OpaqueAlphaChannel,
-%      SetAlphaChannel, ShapeAlphaChannel, and TransparentAlphaChannel.
+%      DisassociateAlphaChannel,  ExtractAlphaChannel, OffAlphaChannel,
+%      OnAlphaChannel, OpaqueAlphaChannel, SetAlphaChannel, ShapeAlphaChannel,
+%      and TransparentAlphaChannel.
 %
 %    o exception: return any errors or warnings in this structure.
 %
@@ -1017,7 +1018,7 @@
       /*
         Set transparent pixels to background color.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         break;
       status=SetImageStorageClass(image,DirectClass,exception);
       if (status == MagickFalse)
@@ -1074,7 +1075,7 @@
     }
     case DeactivateAlphaChannel:
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         status=SetImageAlpha(image,OpaqueAlpha,exception);
       image->alpha_trait=CopyPixelTrait;
       break;
@@ -1154,6 +1155,17 @@
       image->alpha_trait=UndefinedPixelTrait;
       break;
     }
+    case OffAlphaChannel:
+    {
+      image->alpha_trait=UndefinedPixelTrait;
+      break;
+    }
+    case OnAlphaChannel:
+    {
+      status=SetImageAlpha(image,OpaqueAlpha,exception);
+      image->alpha_trait=BlendPixelTrait;
+      break;
+    }
     case OpaqueAlphaChannel:
     {
       status=SetImageAlpha(image,OpaqueAlpha,exception);
@@ -1164,7 +1176,7 @@
       /*
         Remove transparency.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         break;
       status=SetImageStorageClass(image,DirectClass,exception);
       if (status == MagickFalse)
@@ -1207,7 +1219,7 @@
     }
     case SetAlphaChannel:
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         status=SetImageAlpha(image,OpaqueAlpha,exception);
       break;
     }
diff --git a/MagickCore/color.c b/MagickCore/color.c
index 8e46550..9e81e6e 100644
--- a/MagickCore/color.c
+++ b/MagickCore/color.c
@@ -1526,7 +1526,7 @@
       ConcatentateHexColorComponent(pixel,BluePixelChannel,tuple);
       if (pixel->colorspace == CMYKColorspace)
         ConcatentateHexColorComponent(pixel,BlackPixelChannel,tuple);
-      if ((pixel->alpha_trait == BlendPixelTrait) &&
+      if ((pixel->alpha_trait != UndefinedPixelTrait) &&
           (pixel->alpha != OpaqueAlpha))
         ConcatentateHexColorComponent(pixel,AlphaPixelChannel,tuple);
       return;
@@ -1555,7 +1555,7 @@
       if (color.colorspace-CMYKColorspace)
         status&=IsMagickTrue(fabs(color.black-SVGCompliant(color.black))
              < MagickEpsilon);
-      if (color.alpha_trait == BlendPixelTrait)
+      if (color.alpha_trait != UndefinedPixelTrait)
         status&=IsMagickTrue(fabs(color.alpha-SVGCompliant(color.alpha))
              < MagickEpsilon);
       if (IfMagickTrue(status))
@@ -1563,7 +1563,7 @@
     }
   (void) ConcatenateMagickString(tuple,CommandOptionToMnemonic(
     MagickColorspaceOptions,(ssize_t) color.colorspace),MaxTextExtent);
-  if (color.alpha_trait == BlendPixelTrait)
+  if (color.alpha_trait != UndefinedPixelTrait)
     (void) ConcatenateMagickString(tuple,"a",MaxTextExtent);
   (void) ConcatenateMagickString(tuple,"(",MaxTextExtent);
   if (color.colorspace == GRAYColorspace)
@@ -1581,7 +1581,7 @@
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&color,BlackPixelChannel,SVGCompliance,tuple);
     }
-  if (color.alpha_trait == BlendPixelTrait)
+  if (color.alpha_trait != UndefinedPixelTrait)
     {
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&color,AlphaPixelChannel,SVGCompliance,tuple);
@@ -1675,7 +1675,7 @@
   register double
     distance;
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     return(MagickTrue);
   if (p->alpha == q->alpha)
     return(MagickTrue);
@@ -2416,12 +2416,12 @@
                 color->black=(double) ClampToQuantum(scale*
                   geometry_info.psi);
               else
-                if (color->alpha_trait == BlendPixelTrait)
+                if (color->alpha_trait != UndefinedPixelTrait)
                   color->alpha=(double) ClampToQuantum(QuantumRange*
                     geometry_info.psi);
             }
           if (((flags & ChiValue) != 0) &&
-              (color->alpha_trait == BlendPixelTrait))
+              (color->alpha_trait != UndefinedPixelTrait))
             color->alpha=(double) ClampToQuantum(QuantumRange*
               geometry_info.chi);
           if (color->colorspace == LabColorspace)
@@ -2439,7 +2439,7 @@
               color->green=color->red;
               color->blue=color->red;
               if (((flags & SigmaValue) != 0) &&
-                  (color->alpha_trait == BlendPixelTrait))
+                  (color->alpha_trait != UndefinedPixelTrait))
                 color->alpha=(double) ClampToQuantum(QuantumRange*
                   geometry_info.sigma);
             }
@@ -2580,7 +2580,7 @@
   GetColorTuple(&pixel,IsMagickTrue(compliance != SVGCompliance),name);
   if (IfMagickFalse(IssRGBColorspace(pixel.colorspace)))
     return(MagickFalse);
-  alpha=color->alpha_trait == BlendPixelTrait ? color->alpha : OpaqueAlpha;
+  alpha=color->alpha_trait != UndefinedPixelTrait ? color->alpha : OpaqueAlpha;
   (void) GetColorInfo("*",exception);
   ResetLinkedListIterator(color_cache);
   p=(const ColorInfo *) GetNextValueInLinkedList(color_cache);
diff --git a/MagickCore/colorspace.c b/MagickCore/colorspace.c
index 14c6219..661fe28 100644
--- a/MagickCore/colorspace.c
+++ b/MagickCore/colorspace.c
@@ -317,7 +317,7 @@
           status=MagickFalse;
       }
       image_view=DestroyCacheView(image_view);
-      image->type=image->alpha_trait != BlendPixelTrait ? ColorSeparationType :
+      image->type=image->alpha_trait == UndefinedPixelTrait ? ColorSeparationType :
         ColorSeparationMatteType;
       if (SetImageColorspace(image,colorspace,exception) == MagickFalse)
         return(MagickFalse);
diff --git a/MagickCore/composite.c b/MagickCore/composite.c
index 36e5225..14d297d 100644
--- a/MagickCore/composite.c
+++ b/MagickCore/composite.c
@@ -760,7 +760,7 @@
         Modify destination outside the overlaid region and require an alpha
         channel to exist, to add transparency.
       */
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       SetPixelAlphaTraits(image,CopyPixelTrait);
       break;
@@ -1632,7 +1632,7 @@
               case CopyAlphaCompositeOp:
               {
                 pixel=QuantumRange*Sa;
-                if (composite_image->alpha_trait != BlendPixelTrait)
+                if (composite_image->alpha_trait == UndefinedPixelTrait)
                   pixel=GetPixelIntensity(composite_image,p);
                 break;
               }
@@ -2416,8 +2416,8 @@
   status=MagickTrue;
   if ((image->compose != CopyCompositeOp) &&
       ((image->compose != OverCompositeOp) ||
-       (image->alpha_trait == BlendPixelTrait) ||
-       (texture_image->alpha_trait == BlendPixelTrait)))
+       (image->alpha_trait != UndefinedPixelTrait) ||
+       (texture_image->alpha_trait != UndefinedPixelTrait)))
     {
       /*
         Tile texture onto the image background.
diff --git a/MagickCore/decorate.c b/MagickCore/decorate.c
index dc70ea6..cc322f5 100644
--- a/MagickCore/decorate.c
+++ b/MagickCore/decorate.c
@@ -233,8 +233,8 @@
   if ((IsPixelInfoGray(&frame_image->border_color) == MagickFalse) &&
       (IsGrayColorspace(frame_image->colorspace) != MagickFalse))
     (void) SetImageColorspace(frame_image,sRGBColorspace,exception);
-  if ((frame_image->matte_color.alpha_trait == BlendPixelTrait) &&
-      (frame_image->alpha_trait != BlendPixelTrait))
+  if ((frame_image->matte_color.alpha_trait != UndefinedPixelTrait) &&
+      (frame_image->alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlpha(frame_image,OpaqueAlpha,exception);
   frame_image->page=image->page;
   if ((image->page.width != 0) && (image->page.height != 0))
@@ -429,7 +429,7 @@
       Set frame interior to interior color.
     */
     if ((compose != CopyCompositeOp) && ((compose != OverCompositeOp) ||
-        (image->alpha_trait == BlendPixelTrait)))
+        (image->alpha_trait != UndefinedPixelTrait)))
       for (x=0; x < (ssize_t) image->columns; x++)
       {
         SetPixelInfoPixel(frame_image,&interior,q);
@@ -606,7 +606,7 @@
   frame_view=DestroyCacheView(frame_view);
   image_view=DestroyCacheView(image_view);
   if ((compose != CopyCompositeOp) && ((compose != OverCompositeOp) ||
-      (image->alpha_trait == BlendPixelTrait)))
+      (image->alpha_trait != UndefinedPixelTrait)))
     {
       x=(ssize_t) (frame_info->outer_bevel+(frame_info->x-bevel_width)+
         frame_info->inner_bevel);
diff --git a/MagickCore/display.c b/MagickCore/display.c
index 625771b..3f1c55f 100644
--- a/MagickCore/display.c
+++ b/MagickCore/display.c
@@ -8008,7 +8008,7 @@
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) SetImageType(*image,(*image)->alpha_trait != BlendPixelTrait ?
+      (void) SetImageType(*image,(*image)->alpha_trait == UndefinedPixelTrait ?
         GrayscaleType : GrayscaleMatteType,exception);
       XSetCursorState(display,windows,MagickFalse);
       if (IfMagickTrue(windows->image.orphan) )
@@ -9163,7 +9163,7 @@
       Image
         *matte_image;
 
-      if ((*image)->alpha_trait != BlendPixelTrait)
+      if ((*image)->alpha_trait == UndefinedPixelTrait)
         {
           XNoticeWidget(display,windows,
             "Image does not have any matte information",(*image)->filename);
@@ -10096,7 +10096,7 @@
           continue;
         if (IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
           return(MagickFalse);
-        if ((*image)->alpha_trait != BlendPixelTrait)
+        if ((*image)->alpha_trait == UndefinedPixelTrait)
           (void) SetImageAlphaChannel(*image,OpaqueAlphaChannel,exception);
         image_view=AcquireAuthenticCacheView(*image,exception);
         switch (method)
diff --git a/MagickCore/distort.c b/MagickCore/distort.c
index 21b857f..97c5f09 100644
--- a/MagickCore/distort.c
+++ b/MagickCore/distort.c
@@ -1519,7 +1519,7 @@
     exception);
   tmp_image->image_info=image->image_info; /* preserve global options */
 
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       /*
         Image has not transparency channel, so we free to use it
@@ -2295,7 +2295,7 @@
   if ((IsPixelInfoGray(&distort_image->background_color) == MagickFalse) &&
       (IsGrayColorspace(distort_image->colorspace) != MagickFalse))
     (void) SetImageColorspace(distort_image,sRGBColorspace,exception);
-  if (distort_image->background_color.alpha_trait == BlendPixelTrait)
+  if (distort_image->background_color.alpha_trait != UndefinedPixelTrait)
     distort_image->alpha_trait=BlendPixelTrait;
   distort_image->page.x=geometry.x;
   distort_image->page.y=geometry.y;
@@ -2928,7 +2928,7 @@
       (image->colorspace == CMYKColorspace))
     number_colors++;
   if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-      (image->alpha_trait == BlendPixelTrait))
+      (image->alpha_trait != UndefinedPixelTrait))
     number_colors++;
 
   /*
@@ -2980,7 +2980,7 @@
           (void) FormatLocaleFile(stderr, "  -channel K -fx '%+lf*i %+lf*j %+lf' \\\n",
               coeff[x], coeff[x+1], coeff[x+2]),x+=3;
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           (void) FormatLocaleFile(stderr, "  -channel A -fx '%+lf*i %+lf*j %+lf' \\\n",
               coeff[x], coeff[x+1], coeff[x+2]),x+=3;
         break;
@@ -3007,7 +3007,7 @@
               coeff[ x ], coeff[x+1],
               coeff[x+2], coeff[x+3]),x+=4;
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           (void) FormatLocaleFile(stderr, "   -channel A -fx '%+lf*i %+lf*j %+lf*i*j %+lf;\n",
               coeff[ x ], coeff[x+1],
               coeff[x+2], coeff[x+3]),x+=4;
@@ -3097,7 +3097,7 @@
               pixel.black   = coeff[x]*i +coeff[x+1]*j
                               +coeff[x+2], x+=3;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha = coeff[x]*i +coeff[x+1]*j
                               +coeff[x+2], x+=3;
             break;
@@ -3119,7 +3119,7 @@
               pixel.black   = coeff[x]*i     + coeff[x+1]*j +
                               coeff[x+2]*i*j + coeff[x+3], x+=4;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha = coeff[x]*i     + coeff[x+1]*j +
                               coeff[x+2]*i*j + coeff[x+3], x+=4;
             break;
@@ -3142,7 +3142,7 @@
                 (image->colorspace == CMYKColorspace))
               pixel.black=0.0;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha=0.0;
             denominator = 0.0;
             for(k=0; k<number_arguments; k+=2+number_colors) {
@@ -3162,7 +3162,7 @@
                   (image->colorspace == CMYKColorspace))
                 pixel.black   += arguments[x++]*weight;
               if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                  (image->alpha_trait == BlendPixelTrait))
+                  (image->alpha_trait != UndefinedPixelTrait))
                 pixel.alpha += arguments[x++]*weight;
               denominator += weight;
             }
@@ -3176,7 +3176,7 @@
                 (image->colorspace == CMYKColorspace))
               pixel.black/=denominator;
             if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                (image->alpha_trait == BlendPixelTrait))
+                (image->alpha_trait != UndefinedPixelTrait))
               pixel.alpha/=denominator;
             break;
           }
@@ -3208,7 +3208,7 @@
                     (image->colorspace == CMYKColorspace))
                   pixel.black=arguments[x++];
                 if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-                    (image->alpha_trait == BlendPixelTrait))
+                    (image->alpha_trait != UndefinedPixelTrait))
                   pixel.alpha=arguments[x++];
                 minimum = distance;
               }
@@ -3227,7 +3227,7 @@
             (image->colorspace == CMYKColorspace))
           pixel.black*=QuantumRange;
         if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-            (image->alpha_trait == BlendPixelTrait))
+            (image->alpha_trait != UndefinedPixelTrait))
           pixel.alpha*=QuantumRange;
         SetPixelInfoPixel(sparse_image,&pixel,q);
         q+=GetPixelChannels(sparse_image);
diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 9e816b2..3478c36 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -3946,7 +3946,7 @@
   /*
     Draw polygon or line.
   */
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   start=(ssize_t) ceil(bounds.y1-0.5);
   stop=(ssize_t) floor(bounds.y2+0.5);
@@ -4326,7 +4326,7 @@
     }
     case MattePrimitive:
     {
-      if (image->alpha_trait != BlendPixelTrait)
+      if (image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
       switch (primitive_info->method)
       {
@@ -4522,7 +4522,7 @@
           (void) TransformImage(&composite_image,(char *) NULL,geometry,
             exception);
         }
-      if (composite_image->alpha_trait != BlendPixelTrait)
+      if (composite_image->alpha_trait == UndefinedPixelTrait)
         (void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel,
           exception);
       if (draw_info->alpha != OpaqueAlpha)
diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c
index ee518c7..f1f8cde 100644
--- a/MagickCore/enhance.c
+++ b/MagickCore/enhance.c
@@ -411,7 +411,7 @@
   }
   image_view=DestroyCacheView(image_view);
   clut_map=(PixelInfo *) RelinquishMagickMemory(clut_map);
-  if ((clut_image->alpha_trait == BlendPixelTrait) &&
+  if ((clut_image->alpha_trait != UndefinedPixelTrait) &&
       ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0))
     (void) SetImageAlphaChannel(image,ActivateAlphaChannel,exception);
   return(status);
@@ -2187,7 +2187,7 @@
   assert(hald_image->signature == MagickSignature);
   if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
     return(MagickFalse);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   /*
     Hald clut image.
@@ -2275,7 +2275,7 @@
           (image->colorspace == CMYKColorspace))
         SetPixelBlack(image,ClampToQuantum(pixel.black),q);
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
       q+=GetPixelChannels(image);
     }
@@ -2718,7 +2718,7 @@
           (void) SetImageChannelMask(image,channel_mask);
         }
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         {
           channel_mask=SetImageChannelMask(image,AlphaChannel);
           status&=LevelImage(image,black_color->alpha,white_color->alpha,1.0,
@@ -2758,7 +2758,7 @@
           (void) SetImageChannelMask(image,channel_mask);
         }
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         {
           channel_mask=SetImageChannelMask(image,AlphaChannel);
           status&=LevelizeImage(image,black_color->alpha,white_color->alpha,1.0,
diff --git a/MagickCore/feature.c b/MagickCore/feature.c
index 23d952b..512b8ec 100644
--- a/MagickCore/feature.c
+++ b/MagickCore/feature.c
@@ -742,7 +742,7 @@
       if (image->colorspace == CMYKColorspace)
         grays[ScaleQuantumToMap(GetPixelBlack(image,p))].black=
           ScaleQuantumToMap(GetPixelBlack(image,p));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         grays[ScaleQuantumToMap(GetPixelAlpha(image,p))].alpha=
           ScaleQuantumToMap(GetPixelAlpha(image,p));
       p+=GetPixelChannels(image);
@@ -768,7 +768,7 @@
     if (image->colorspace == CMYKColorspace)
       if (grays[i].black != ~0U)
         grays[gray.black++].black=grays[i].black;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       if (grays[i].alpha != ~0U)
         grays[gray.alpha++].alpha=grays[i].alpha;
   }
@@ -783,7 +783,7 @@
   if (image->colorspace == CMYKColorspace)
     if (gray.black > number_grays)
       number_grays=gray.black;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     if (gray.alpha > number_grays)
       number_grays=gray.alpha;
   cooccurrence=(ChannelStatistics **) AcquireQuantumMemory(number_grays,
@@ -985,7 +985,7 @@
             cooccurrence[u][v].direction[i].black++;
             cooccurrence[v][u].direction[i].black++;
           }
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           {
             u=0;
             v=0;
@@ -1074,7 +1074,7 @@
         cooccurrence[x][y].direction[i].blue*=normalize;
         if (image->colorspace == CMYKColorspace)
           cooccurrence[x][y].direction[i].black*=normalize;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           cooccurrence[x][y].direction[i].alpha*=normalize;
       }
     }
@@ -1114,7 +1114,7 @@
           channel_features[BlackPixelChannel].angular_second_moment[i]+=
             cooccurrence[x][y].direction[i].black*
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channel_features[AlphaPixelChannel].angular_second_moment[i]+=
             cooccurrence[x][y].direction[i].alpha*
             cooccurrence[x][y].direction[i].alpha;
@@ -1126,7 +1126,7 @@
         sum[y].direction[i].blue+=cooccurrence[x][y].direction[i].blue;
         if (image->colorspace == CMYKColorspace)
           sum[y].direction[i].black+=cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           sum[y].direction[i].alpha+=cooccurrence[x][y].direction[i].alpha;
         correlation.direction[i].red+=x*y*cooccurrence[x][y].direction[i].red;
         correlation.direction[i].green+=x*y*
@@ -1136,7 +1136,7 @@
         if (image->colorspace == CMYKColorspace)
           correlation.direction[i].black+=x*y*
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           correlation.direction[i].alpha+=x*y*
             cooccurrence[x][y].direction[i].alpha;
         /*
@@ -1151,7 +1151,7 @@
         if (image->colorspace == CMYKColorspace)
           channel_features[BlackPixelChannel].inverse_difference_moment[i]+=
             cooccurrence[x][y].direction[i].black/((y-x)*(y-x)+1);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channel_features[AlphaPixelChannel].inverse_difference_moment[i]+=
             cooccurrence[x][y].direction[i].alpha/((y-x)*(y-x)+1);
         /*
@@ -1166,7 +1166,7 @@
         if (image->colorspace == CMYKColorspace)
           density_xy[y+x+2].direction[i].black+=
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_xy[y+x+2].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
         /*
@@ -1185,7 +1185,7 @@
           channel_features[BlackPixelChannel].entropy[i]-=
             cooccurrence[x][y].direction[i].black*
             MagickLog10(cooccurrence[x][y].direction[i].black);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           channel_features[AlphaPixelChannel].entropy[i]-=
             cooccurrence[x][y].direction[i].alpha*
             MagickLog10(cooccurrence[x][y].direction[i].alpha);
@@ -1195,7 +1195,7 @@
         density_x[x].direction[i].red+=cooccurrence[x][y].direction[i].red;
         density_x[x].direction[i].green+=cooccurrence[x][y].direction[i].green;
         density_x[x].direction[i].blue+=cooccurrence[x][y].direction[i].blue;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_x[x].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
         if (image->colorspace == CMYKColorspace)
@@ -1207,7 +1207,7 @@
         if (image->colorspace == CMYKColorspace)
           density_y[y].direction[i].black+=
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_y[y].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
       }
@@ -1222,7 +1222,7 @@
           mean.direction[i].black+=y*sum[y].direction[i].black;
           sum_squares.direction[i].black+=y*y*sum[y].direction[i].black;
         }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           mean.direction[i].alpha+=y*sum[y].direction[i].alpha;
           sum_squares.direction[i].alpha+=y*y*sum[y].direction[i].alpha;
@@ -1256,7 +1256,7 @@
         (mean.direction[i].black*mean.direction[i].black))*sqrt(
         sum_squares.direction[i].black-(mean.direction[i].black*
         mean.direction[i].black)));
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].correlation[i]=
         (correlation.direction[i].alpha-mean.direction[i].alpha*
         mean.direction[i].alpha)/(sqrt(sum_squares.direction[i].alpha-
@@ -1290,7 +1290,7 @@
       if (image->colorspace == CMYKColorspace)
         channel_features[BlackPixelChannel].sum_average[i]+=
           x*density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].sum_average[i]+=
           x*density_xy[x].direction[i].alpha;
       /*
@@ -1309,7 +1309,7 @@
         channel_features[BlackPixelChannel].sum_entropy[i]-=
           density_xy[x].direction[i].black*
           MagickLog10(density_xy[x].direction[i].black);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].sum_entropy[i]-=
           density_xy[x].direction[i].alpha*
           MagickLog10(density_xy[x].direction[i].alpha);
@@ -1333,7 +1333,7 @@
           (x-channel_features[BlackPixelChannel].sum_entropy[i])*
           (x-channel_features[BlackPixelChannel].sum_entropy[i])*
           density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].sum_variance[i]+=
           (x-channel_features[AlphaPixelChannel].sum_entropy[i])*
           (x-channel_features[AlphaPixelChannel].sum_entropy[i])*
@@ -1371,7 +1371,7 @@
         if (image->colorspace == CMYKColorspace)
           variance.direction[i].black+=(y-mean.direction[i].black+1)*
             (y-mean.direction[i].black+1)*cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           variance.direction[i].alpha+=(y-mean.direction[i].alpha+1)*
             (y-mean.direction[i].alpha+1)*
             cooccurrence[x][y].direction[i].alpha;
@@ -1387,7 +1387,7 @@
         if (image->colorspace == CMYKColorspace)
           density_xy[MagickAbsoluteValue(y-x)].direction[i].black+=
             cooccurrence[x][y].direction[i].black;
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           density_xy[MagickAbsoluteValue(y-x)].direction[i].alpha+=
             cooccurrence[x][y].direction[i].alpha;
         /*
@@ -1402,7 +1402,7 @@
         if (image->colorspace == CMYKColorspace)
           entropy_xy.direction[i].black-=cooccurrence[x][y].direction[i].black*
             MagickLog10(cooccurrence[x][y].direction[i].black);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           entropy_xy.direction[i].alpha-=
             cooccurrence[x][y].direction[i].alpha*MagickLog10(
             cooccurrence[x][y].direction[i].alpha);
@@ -1417,7 +1417,7 @@
           entropy_xy1.direction[i].black-=(
             cooccurrence[x][y].direction[i].black*MagickLog10(
             density_x[x].direction[i].black*density_y[y].direction[i].black));
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           entropy_xy1.direction[i].alpha-=(
             cooccurrence[x][y].direction[i].alpha*MagickLog10(
             density_x[x].direction[i].alpha*density_y[y].direction[i].alpha));
@@ -1434,7 +1434,7 @@
           entropy_xy2.direction[i].black-=(density_x[x].direction[i].black*
             density_y[y].direction[i].black*MagickLog10(
             density_x[x].direction[i].black*density_y[y].direction[i].black));
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           entropy_xy2.direction[i].alpha-=(density_x[x].direction[i].alpha*
             density_y[y].direction[i].alpha*MagickLog10(
             density_x[x].direction[i].alpha*density_y[y].direction[i].alpha));
@@ -1449,7 +1449,7 @@
     if (image->colorspace == CMYKColorspace)
       channel_features[BlackPixelChannel].variance_sum_of_squares[i]=
         variance.direction[i].black;
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].variance_sum_of_squares[i]=
         variance.direction[i].alpha;
   }
@@ -1477,7 +1477,7 @@
       variance.direction[i].blue+=density_xy[x].direction[i].blue;
       if (image->colorspace == CMYKColorspace)
         variance.direction[i].black+=density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         variance.direction[i].alpha+=density_xy[x].direction[i].alpha;
       sum_squares.direction[i].red+=density_xy[x].direction[i].red*
         density_xy[x].direction[i].red;
@@ -1488,7 +1488,7 @@
       if (image->colorspace == CMYKColorspace)
         sum_squares.direction[i].black+=density_xy[x].direction[i].black*
           density_xy[x].direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         sum_squares.direction[i].alpha+=density_xy[x].direction[i].alpha*
           density_xy[x].direction[i].alpha;
       /*
@@ -1507,7 +1507,7 @@
         channel_features[BlackPixelChannel].difference_entropy[i]-=
           density_xy[x].direction[i].black*
           MagickLog10(density_xy[x].direction[i].black);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].difference_entropy[i]-=
           density_xy[x].direction[i].alpha*
           MagickLog10(density_xy[x].direction[i].alpha);
@@ -1523,7 +1523,7 @@
       if (image->colorspace == CMYKColorspace)
         entropy_x.direction[i].black-=(density_x[x].direction[i].black*
           MagickLog10(density_x[x].direction[i].black));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         entropy_x.direction[i].alpha-=(density_x[x].direction[i].alpha*
           MagickLog10(density_x[x].direction[i].alpha));
       entropy_y.direction[i].red-=(density_y[x].direction[i].red*
@@ -1535,7 +1535,7 @@
       if (image->colorspace == CMYKColorspace)
         entropy_y.direction[i].black-=(density_y[x].direction[i].black*
           MagickLog10(density_y[x].direction[i].black));
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         entropy_y.direction[i].alpha-=(density_y[x].direction[i].alpha*
           MagickLog10(density_y[x].direction[i].alpha));
     }
@@ -1559,7 +1559,7 @@
         (((double) number_grays*number_grays*sum_squares.direction[i].black)-
         (variance.direction[i].black*variance.direction[i].black))/
         ((double) number_grays*number_grays*number_grays*number_grays);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].difference_variance[i]=
         (((double) number_grays*number_grays*sum_squares.direction[i].alpha)-
         (variance.direction[i].alpha*variance.direction[i].alpha))/
@@ -1584,7 +1584,7 @@
         (entropy_xy.direction[i].black-entropy_xy1.direction[i].black)/
         (entropy_x.direction[i].black > entropy_y.direction[i].black ?
          entropy_x.direction[i].black : entropy_y.direction[i].black);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].measure_of_correlation_1[i]=
         (entropy_xy.direction[i].alpha-entropy_xy1.direction[i].alpha)/
         (entropy_x.direction[i].alpha > entropy_y.direction[i].alpha ?
@@ -1602,7 +1602,7 @@
       channel_features[BlackPixelChannel].measure_of_correlation_2[i]=
         (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].black-
         entropy_xy.direction[i].black)))));
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].measure_of_correlation_2[i]=
         (sqrt(fabs(1.0-exp(-2.0*(entropy_xy2.direction[i].alpha-
         entropy_xy.direction[i].alpha)))));
@@ -1645,7 +1645,7 @@
               pixel.direction[i].blue+=cooccurrence[x][y].direction[i].blue;
               if (image->colorspace == CMYKColorspace)
                 pixel.direction[i].black+=cooccurrence[x][y].direction[i].black;
-              if (image->alpha_trait == BlendPixelTrait)
+              if (image->alpha_trait != UndefinedPixelTrait)
                 pixel.direction[i].alpha+=
                   cooccurrence[x][y].direction[i].alpha;
             }
@@ -1665,7 +1665,7 @@
             Q[z][y].direction[i].black+=cooccurrence[z][x].direction[i].black*
               cooccurrence[y][x].direction[i].black/
               density_x[z].direction[i].black/density_y[x].direction[i].black;
-          if (image->alpha_trait == BlendPixelTrait)
+          if (image->alpha_trait != UndefinedPixelTrait)
             Q[z][y].direction[i].alpha+=
               cooccurrence[z][x].direction[i].alpha*
               cooccurrence[y][x].direction[i].alpha/
@@ -1682,7 +1682,7 @@
       if (image->colorspace == CMYKColorspace)
         channel_features[BlackPixelChannel].contrast[i]+=z*z*
           pixel.direction[i].black;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         channel_features[AlphaPixelChannel].contrast[i]+=z*z*
           pixel.direction[i].alpha;
     }
@@ -1699,7 +1699,7 @@
     if (image->colorspace == CMYKColorspace)
       channel_features[BlackPixelChannel].maximum_correlation_coefficient[i]=
         sqrt((double) -1.0);
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       channel_features[AlphaPixelChannel].maximum_correlation_coefficient[i]=
         sqrt((double) -1.0);
   }
diff --git a/MagickCore/fourier.c b/MagickCore/fourier.c
index b4b1273..e20da1f 100644
--- a/MagickCore/fourier.c
+++ b/MagickCore/fourier.c
@@ -1017,7 +1017,7 @@
                   thread_status;
 
                 thread_status=MagickTrue;
-                if (image->alpha_trait == BlendPixelTrait)
+                if (image->alpha_trait != UndefinedPixelTrait)
                   thread_status=ForwardFourierTransformChannel(image,
                     AlphaPixelChannel,modulus,fourier_image,exception);
                 if (thread_status == MagickFalse)
@@ -1584,7 +1584,7 @@
               thread_status;
 
             thread_status=MagickTrue;
-            if (magnitude_image->alpha_trait == BlendPixelTrait)
+            if (magnitude_image->alpha_trait != UndefinedPixelTrait)
               thread_status=InverseFourierTransformChannel(magnitude_image,
                 phase_image,AlphaPixelChannel,modulus,fourier_image,exception);
             if (thread_status == MagickFalse)
diff --git a/MagickCore/fx.c b/MagickCore/fx.c
index 518e338..44c4e5e 100644
--- a/MagickCore/fx.c
+++ b/MagickCore/fx.c
@@ -701,8 +701,8 @@
   if ((IsGrayColorspace(image->colorspace) != MagickFalse) ||
       (IsPixelInfoGray(colorize) != MagickFalse))
     (void) SetImageColorspace(colorize_image,sRGBColorspace,exception);
-  if ((colorize_image->alpha_trait != BlendPixelTrait) &&
-      (colorize->alpha_trait == BlendPixelTrait))
+  if ((colorize_image->alpha_trait == UndefinedPixelTrait) &&
+      (colorize->alpha_trait != UndefinedPixelTrait))
     (void) SetImageAlpha(colorize_image,OpaqueAlpha,exception);
   if (blend == (const char *) NULL)
     return(colorize_image);
@@ -993,7 +993,7 @@
           GetPixelGreen(image,p)+ColorMatrix[v][2]*GetPixelBlue(image,p);
         if (image->colorspace == CMYKColorspace)
           sum+=ColorMatrix[v][3]*GetPixelBlack(image,p);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           sum+=ColorMatrix[v][4]*GetPixelAlpha(image,p);
         sum+=QuantumRange*ColorMatrix[v][5];
         switch (v)
@@ -1487,7 +1487,7 @@
           double
             alpha;
 
-          if (pixel.alpha_trait != BlendPixelTrait)
+          if (pixel.alpha_trait == UndefinedPixelTrait)
             return(1.0);
           alpha=(double) (QuantumScale*pixel.alpha);
           return(alpha);
@@ -4292,7 +4292,7 @@
   clone_image=DestroyImage(clone_image);
   if (border_image == (Image *) NULL)
     return((Image *) NULL);
-  if (border_image->alpha_trait != BlendPixelTrait)
+  if (border_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(border_image,OpaqueAlphaChannel,exception);
   /*
     Shadow image.
@@ -4323,7 +4323,7 @@
     background_color.alpha_trait=BlendPixelTrait;
     for (x=0; x < (ssize_t) border_image->columns; x++)
     {
-      if (border_image->alpha_trait == BlendPixelTrait)
+      if (border_image->alpha_trait != UndefinedPixelTrait)
         background_color.alpha=GetPixelAlpha(border_image,q)*alpha/100.0;
       SetPixelInfoPixel(border_image,&background_color,q);
       q+=GetPixelChannels(border_image);
diff --git a/MagickCore/histogram.c b/MagickCore/histogram.c
index d28d776..0c54abd 100644
--- a/MagickCore/histogram.c
+++ b/MagickCore/histogram.c
@@ -166,7 +166,7 @@
     ((ScaleQuantumToChar(ClampToQuantum(pixel->red)) >> index) & 0x01) |
     ((ScaleQuantumToChar(ClampToQuantum(pixel->green)) >> index) & 0x01) << 1 |
     ((ScaleQuantumToChar(ClampToQuantum(pixel->blue)) >> index) & 0x01) << 2);
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     id|=((ScaleQuantumToChar(ClampToQuantum(pixel->alpha)) >> index) &
       0x01) << 3;
   return(id);
@@ -342,7 +342,7 @@
   /*
     Traverse any children.
   */
-  number_children=image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
+  number_children=image->alpha_trait == UndefinedPixelTrait ? 8UL : 16UL;
   for (i=0; i < (ssize_t) number_children; i++)
     if (node_info->child[i] != (NodeInfo *) NULL)
       DefineImageHistogram(image,node_info->child[i],histogram);
@@ -441,7 +441,7 @@
   /*
     Traverse any children.
   */
-  number_children=image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
+  number_children=image->alpha_trait == UndefinedPixelTrait ? 8UL : 16UL;
   for (i=0; i < (ssize_t) number_children; i++)
     if (node_info->child[i] != (NodeInfo *) NULL)
       DestroyColorCube(image,node_info->child[i]);
@@ -1142,7 +1142,7 @@
         ConcatenateColorComponent(&pixel,BlackPixelChannel,X11Compliance,
           tuple);
       }
-    if (pixel.alpha_trait == BlendPixelTrait)
+    if (pixel.alpha_trait != UndefinedPixelTrait)
       {
         (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
         ConcatenateColorComponent(&pixel,AlphaPixelChannel,X11Compliance,
@@ -1215,7 +1215,7 @@
   /*
     Traverse any children.
   */
-  number_children=unique_image->alpha_trait != BlendPixelTrait ? 8UL : 16UL;
+  number_children=unique_image->alpha_trait == UndefinedPixelTrait ? 8UL : 16UL;
   for (i=0; i < (ssize_t) number_children; i++)
     if (node_info->child[i] != (NodeInfo *) NULL)
       UniqueColorsToImage(unique_image,unique_view,cube_info,
diff --git a/MagickCore/identify.c b/MagickCore/identify.c
index ee50a93..73c4995 100644
--- a/MagickCore/identify.c
+++ b/MagickCore/identify.c
@@ -549,7 +549,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(
@@ -756,7 +756,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.0;
@@ -801,7 +801,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)
@@ -849,7 +849,7 @@
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelMoments(file,AlphaPixelChannel,"Alpha",scale,
           channel_moments);
       if (colorspace != GRAYColorspace)
@@ -870,7 +870,7 @@
         channel_phash);
       (void) PrintChannelPerceptualHash(file,BluePixelChannel,"Blue, Luma",
         channel_phash);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelPerceptualHash(file,AlphaPixelChannel,"Alpha, Alpha",
           channel_phash);
       channel_phash=(ChannelPerceptualHash *) RelinquishMagickMemory(
@@ -912,7 +912,7 @@
           break;
         }
       }
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         (void) PrintChannelFeatures(file,AlphaPixelChannel,"Alpha",
           channel_features);
       channel_features=(ChannelFeatures *) RelinquishMagickMemory(
@@ -925,7 +925,7 @@
           GetMagickPrecision(),100.0*GetImageTotalInkDensity(image,exception)/
           (double) QuantumRange);
       x=0;
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           register const Quantum
             *p;
@@ -1015,7 +1015,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/MagickCore/image.c b/MagickCore/image.c
index a158f46..35dcb94 100644
--- a/MagickCore/image.c
+++ b/MagickCore/image.c
@@ -489,7 +489,7 @@
   next=GetNextImageInList(images);
   for ( ; next != (Image *) NULL; next=GetNextImageInList(next))
   {
-    if (next->alpha_trait == BlendPixelTrait)
+    if (next->alpha_trait != UndefinedPixelTrait)
       alpha_trait=BlendPixelTrait;
     number_images++;
     if (stack != MagickFalse)
@@ -3168,7 +3168,7 @@
   next=GetNextImageInList(image);
   for ( ; next != (Image *) NULL; next=GetNextImageInList(next))
   {
-    if (next->alpha_trait == BlendPixelTrait)
+    if (next->alpha_trait != UndefinedPixelTrait)
       alpha_trait=BlendPixelTrait;
     number_images++;
     if (stack != MagickFalse)
diff --git a/MagickCore/image.h b/MagickCore/image.h
index 693dbd1..ae2765c 100644
--- a/MagickCore/image.h
+++ b/MagickCore/image.h
@@ -39,6 +39,8 @@
   DiscreteAlphaChannel,
   DisassociateAlphaChannel,
   ExtractAlphaChannel,
+  OffAlphaChannel,
+  OnAlphaChannel,
   OpaqueAlphaChannel,
   RemoveAlphaChannel,
   SetAlphaChannel,
diff --git a/MagickCore/layer.c b/MagickCore/layer.c
index d15a031..1df41a5 100644
--- a/MagickCore/layer.c
+++ b/MagickCore/layer.c
@@ -105,7 +105,7 @@
 
   if (bounds->x < 0)
     return;
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   for (y=0; y < (ssize_t) bounds->height; y++)
   {
@@ -328,7 +328,7 @@
     previous=coalesce_image;
     coalesce_image=GetNextImageInList(coalesce_image);
     (void) CompositeImage(coalesce_image,next,
-      next->alpha_trait == BlendPixelTrait ? OverCompositeOp : CopyCompositeOp,
+      next->alpha_trait != UndefinedPixelTrait ? OverCompositeOp : CopyCompositeOp,
       MagickTrue,next->page.x,next->page.y,exception);
     (void) CloneImageProfiles(coalesce_image,next);
     (void) CloneImageProperties(coalesce_image,next);
@@ -423,7 +423,7 @@
         return((Image *) NULL);
       }
     (void) CompositeImage(current_image,next,
-      next->alpha_trait == BlendPixelTrait ? OverCompositeOp : CopyCompositeOp,
+      next->alpha_trait != UndefinedPixelTrait ? OverCompositeOp : CopyCompositeOp,
       MagickTrue,next->page.x,next->page.y,exception);
     /*
       Handle Background dispose: image is displayed for the delay period.
@@ -531,8 +531,8 @@
   if (method == CompareAnyLayer)
     return((MagickBooleanType)(IsFuzzyEquivalencePixelInfo(p,q) == MagickFalse));
 
-  o1 = (p->alpha_trait == BlendPixelTrait) ? p->alpha : OpaqueAlpha;
-  o2 = (q->alpha_trait == BlendPixelTrait) ? q->alpha : OpaqueAlpha;
+  o1 = (p->alpha_trait != UndefinedPixelTrait) ? p->alpha : OpaqueAlpha;
+  o2 = (q->alpha_trait != UndefinedPixelTrait) ? q->alpha : OpaqueAlpha;
   /*
     Pixel goes from opaque to transprency.
   */
@@ -1494,7 +1494,7 @@
         dispose_image=DestroyImage(dispose_image);
         return;
       }
-    (void) CompositeImage(current_image,next,next->alpha_trait == BlendPixelTrait ?
+    (void) CompositeImage(current_image,next,next->alpha_trait != UndefinedPixelTrait ?
       OverCompositeOp : CopyCompositeOp,MagickTrue,next->page.x,next->page.y,
       exception);
     /*
diff --git a/MagickCore/option.c b/MagickCore/option.c
index 8a0fe5b..7b077e4 100644
--- a/MagickCore/option.c
+++ b/MagickCore/option.c
@@ -104,8 +104,8 @@
     { "Discrete", DiscreteAlphaChannel, UndefinedOptionFlag, MagickFalse },
     { "Disassociate", DisassociateAlphaChannel, UndefinedOptionFlag, MagickFalse },
     { "Extract", ExtractAlphaChannel, UndefinedOptionFlag, MagickFalse },
-    { "Off", DeactivateAlphaChannel, UndefinedOptionFlag, MagickFalse },
-    { "On", ActivateAlphaChannel, UndefinedOptionFlag, MagickFalse },
+    { "Off", OffAlphaChannel, UndefinedOptionFlag, MagickFalse },
+    { "On", OnAlphaChannel, UndefinedOptionFlag, MagickFalse },
     { "Opaque", OpaqueAlphaChannel, UndefinedOptionFlag, MagickFalse },
     { "Remove", RemoveAlphaChannel, UndefinedOptionFlag, MagickFalse },
     { "Set", SetAlphaChannel, UndefinedOptionFlag, MagickFalse },
diff --git a/MagickCore/paint.c b/MagickCore/paint.c
index 640f8df..28e8ae5 100644
--- a/MagickCore/paint.c
+++ b/MagickCore/paint.c
@@ -178,8 +178,8 @@
     return(MagickFalse);
   if (IsGrayColorspace(image->colorspace) != MagickFalse)
     (void) SetImageColorspace(image,sRGBColorspace,exception);
-  if ((image->alpha_trait != BlendPixelTrait) &&
-      (draw_info->fill.alpha_trait == BlendPixelTrait))
+  if ((image->alpha_trait == UndefinedPixelTrait) &&
+      (draw_info->fill.alpha_trait != UndefinedPixelTrait))
     (void) SetImageAlpha(image,OpaqueAlpha,exception);
   /*
     Set floodfill state.
@@ -923,7 +923,7 @@
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
     return(MagickFalse);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   /*
     Make image color transparent.
@@ -1051,7 +1051,7 @@
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
     return(MagickFalse);
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
   /*
     Make image color transparent.
diff --git a/MagickCore/pixel-accessor.h b/MagickCore/pixel-accessor.h
index 96af991..f1da4c2 100644
--- a/MagickCore/pixel-accessor.h
+++ b/MagickCore/pixel-accessor.h
@@ -355,7 +355,7 @@
       pixel[image->channel_map[BlackPixelChannel].offset];
   pixel_info->alpha=(MagickRealType) OpaqueAlpha;
   pixel_info->alpha_trait=UndefinedPixelTrait;
-  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
     {
       pixel_info->alpha=(MagickRealType)
         pixel[image->channel_map[AlphaPixelChannel].offset];
@@ -539,7 +539,7 @@
 static inline void SetPixelAlpha(const Image *restrict image,
   const Quantum alpha,Quantum *restrict pixel)
 {
-  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=alpha;
 }
 
@@ -572,7 +572,7 @@
   if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[BlackPixelChannel].offset]=
       ClampToQuantum(image->background_color.black);
-  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=
       image->background_color.alpha_trait == UndefinedPixelTrait ? OpaqueAlpha :
       ClampToQuantum(image->background_color.alpha);
@@ -708,7 +708,7 @@
   if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[BlackPixelChannel].offset]=
       ClampToQuantum(pixel_info->black);
-  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=
       pixel_info->alpha_trait == UndefinedPixelTrait ? OpaqueAlpha :
       ClampToQuantum(pixel_info->alpha);
@@ -754,7 +754,7 @@
 static inline void SetPixelOpacity(const Image *restrict image,
   const Quantum alpha,Quantum *restrict pixel)
 {
-  if (image->channel_map[AlphaPixelChannel].traits == BlendPixelTrait)
+  if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
     pixel[image->channel_map[AlphaPixelChannel].offset]=QuantumRange-alpha;
 }
 
diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c
index 430c083..19ecff4 100644
--- a/MagickCore/pixel.c
+++ b/MagickCore/pixel.c
@@ -229,8 +229,8 @@
   if ((IsPixelInfoGray(&image->background_color) == MagickFalse) &&
       (IsGrayColorspace(image->colorspace) != MagickFalse))
     (void) TransformImageColorspace(image,sRGBColorspace,exception);
-  if ((destination->alpha_trait == BlendPixelTrait) &&
-      (image->alpha_trait != BlendPixelTrait))
+  if ((destination->alpha_trait != UndefinedPixelTrait) &&
+      (image->alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlpha(image,OpaqueAlpha,exception);
 }
 
@@ -4308,7 +4308,7 @@
   (void) ResetMagickMemory(image->channel_map,0,MaxPixelChannels*
     sizeof(*image->channel_map));
   trait=UpdatePixelTrait;
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     trait=(PixelTrait) (trait | BlendPixelTrait);
   n=0;
   if (image->colorspace == GRAYColorspace)
@@ -4325,7 +4325,7 @@
     }
   if (image->colorspace == CMYKColorspace)
     SetPixelChannelAttributes(image,BlackPixelChannel,trait,n++);
-  if (image->alpha_trait == BlendPixelTrait)
+  if (image->alpha_trait != UndefinedPixelTrait)
     SetPixelChannelAttributes(image,AlphaPixelChannel,CopyPixelTrait,n++);
   if (image->storage_class == PseudoClass)
     SetPixelChannelAttributes(image,IndexPixelChannel,CopyPixelTrait,n++);
@@ -5413,7 +5413,7 @@
 static inline void AlphaBlendPixelInfo(const Image *image,
   const Quantum *pixel,PixelInfo *pixel_info,double *alpha)
 {
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       *alpha=1.0;
       pixel_info->red=(double) GetPixelRed(image,pixel);
@@ -5923,7 +5923,7 @@
     destination->fuzz,(MagickRealType) MagickSQ1_2);
   scale=1.0;
   distance=0.0;
-  if (source->alpha_trait == BlendPixelTrait)
+  if (source->alpha_trait != UndefinedPixelTrait)
     {
       /*
         Transparencies are involved - set alpha distance
@@ -6041,14 +6041,14 @@
       MagickMax(q->fuzz,(MagickRealType) MagickSQ1_2);
   scale=1.0;
   distance=0.0;
-  if ((p->alpha_trait == BlendPixelTrait) ||
-      (q->alpha_trait == BlendPixelTrait))
+  if ((p->alpha_trait != UndefinedPixelTrait) ||
+      (q->alpha_trait != UndefinedPixelTrait))
     {
       /*
         Transparencies are involved - set alpha distance.
       */
-      pixel=(p->alpha_trait == BlendPixelTrait ? p->alpha : OpaqueAlpha)-
-        (q->alpha_trait == BlendPixelTrait ? q->alpha : OpaqueAlpha);
+      pixel=(p->alpha_trait != UndefinedPixelTrait ? p->alpha : OpaqueAlpha)-
+        (q->alpha_trait != UndefinedPixelTrait ? q->alpha : OpaqueAlpha);
       distance=pixel*pixel;
       if (distance > fuzz)
         return(MagickFalse);
@@ -6056,9 +6056,9 @@
         Generate a alpha scaling factor to generate a 4D cone on colorspace.
         If one color is transparent, distance has no color component.
       */
-      if (p->alpha_trait == BlendPixelTrait)
+      if (p->alpha_trait != UndefinedPixelTrait)
         scale=(QuantumScale*p->alpha);
-      if (q->alpha_trait == BlendPixelTrait)
+      if (q->alpha_trait != UndefinedPixelTrait)
         scale*=(QuantumScale*q->alpha);
       if (scale <= MagickEpsilon )
         return(MagickTrue);
@@ -6147,15 +6147,27 @@
   for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
   {
     PixelChannel channel=GetPixelChannelChannel(image,i);
+    if (GetChannelBit(channel_mask,channel) == 0)
+      {
+        SetPixelChannelTraits(image,channel,CopyPixelTrait);
+        continue;
+      }
     if (channel == AlphaPixelChannel)
-      SetPixelChannelTraits(image,channel,
-        GetChannelBit(channel_mask,channel) == 0 ? CopyPixelTrait :
-        image->alpha_trait);
-    else
-      SetPixelChannelTraits(image,channel,
-        GetChannelBit(channel_mask,channel) == 0 ? CopyPixelTrait :
-        (image->alpha_trait == BlendPixelTrait) ? (PixelTrait)
-        (UpdatePixelTrait | BlendPixelTrait) : UpdatePixelTrait);
+      {
+        if ((image->alpha_trait & CopyPixelTrait) != 0)
+          {
+            SetPixelChannelTraits(image,channel,CopyPixelTrait);
+            continue;
+          }
+        SetPixelChannelTraits(image,channel,UpdatePixelTrait);
+        continue;
+      }
+    if (image->alpha_trait != UndefinedPixelTrait)
+      {
+        SetPixelChannelTraits(image,channel,UpdatePixelTrait | BlendPixelTrait);
+        continue;
+      }
+    SetPixelChannelTraits(image,channel,UpdatePixelTrait);
   }
   if (image->storage_class == PseudoClass)
     SetPixelChannelTraits(image,IndexPixelChannel,CopyPixelTrait);
diff --git a/MagickCore/profile.c b/MagickCore/profile.c
index b95f78c..8d1c382 100644
--- a/MagickCore/profile.c
+++ b/MagickCore/profile.c
@@ -1236,19 +1236,19 @@
             {
               case cmsSigRgbData:
               {
-                image->type=image->alpha_trait != BlendPixelTrait ?
+                image->type=image->alpha_trait == UndefinedPixelTrait ?
                   TrueColorType : TrueColorMatteType;
                 break;
               }
               case cmsSigCmykData:
               {
-                image->type=image->alpha_trait != BlendPixelTrait ?
+                image->type=image->alpha_trait == UndefinedPixelTrait ?
                   ColorSeparationType : ColorSeparationMatteType;
                 break;
               }
               case cmsSigGrayData:
               {
-                image->type=image->alpha_trait != BlendPixelTrait ?
+                image->type=image->alpha_trait == UndefinedPixelTrait ?
                   GrayscaleType : GrayscaleMatteType;
                 break;
               }
diff --git a/MagickCore/property.c b/MagickCore/property.c
index 8cdef98..036fabf 100644
--- a/MagickCore/property.c
+++ b/MagickCore/property.c
@@ -2414,7 +2414,7 @@
       (void) FormatLocaleString(value,MaxTextExtent,"%s %s %s",
         CommandOptionToMnemonic(MagickClassOptions,(ssize_t) image->storage_class),
         CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t) colorspace),
-        image->alpha_trait == BlendPixelTrait ? "Alpha" : "");
+        image->alpha_trait != UndefinedPixelTrait ? "Alpha" : "");
       break;
     }
     case 's': /* Image scene number */
@@ -2692,7 +2692,7 @@
             CommandOptionToMnemonic(MagickColorspaceOptions,(ssize_t)
             image->colorspace));
           LocaleLower(value);
-          if( image->alpha_trait == BlendPixelTrait )
+          if( image->alpha_trait != UndefinedPixelTrait )
             (void) ConcatenateMagickString(value,"a",MaxTextExtent);
           break;
         }
diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c
index db6f0e1..1707f1a 100644
--- a/MagickCore/quantize.c
+++ b/MagickCore/quantize.c
@@ -755,7 +755,7 @@
   MagickBooleanType
     associate_alpha;
 
-  associate_alpha=image->alpha_trait == BlendPixelTrait ? MagickTrue :
+  associate_alpha=image->alpha_trait != UndefinedPixelTrait ? MagickTrue :
     MagickFalse;
   if ((cube_info->quantize_info->number_colors == 2) &&
       (cube_info->quantize_info->colorspace == GRAYColorspace))
@@ -2246,7 +2246,7 @@
     for (x=0; x < (ssize_t) image->columns; x++)
     {
       index=1UL*GetPixelIndex(image,p);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         {
           alpha=(double) (QuantumScale*GetPixelAlpha(image,p));
           beta=(double) (QuantumScale*image->colormap[index].alpha);
@@ -2447,7 +2447,7 @@
           (image->colorspace == CMYKColorspace))
         SetPixelBlack(image,PosterizePixel(GetPixelBlack(image,q)),q);
       if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->alpha_trait == BlendPixelTrait))
+          (image->alpha_trait != UndefinedPixelTrait))
         SetPixelAlpha(image,PosterizePixel(GetPixelAlpha(image,q)),q);
       q+=GetPixelChannels(image);
     }
@@ -2750,7 +2750,7 @@
     maximum_colors=MaxColormapSize;
   if (maximum_colors > MaxColormapSize)
     maximum_colors=MaxColormapSize;
-  if (image->alpha_trait != BlendPixelTrait)
+  if (image->alpha_trait == UndefinedPixelTrait)
     {
       if ((image->columns*image->rows) <= maximum_colors)
         (void) DirectToColormapImage(image,exception);
@@ -2774,7 +2774,7 @@
         colors>>=2;
       if ((quantize_info->dither_method != NoDitherMethod) && (depth > 2))
         depth--;
-      if ((image->alpha_trait == BlendPixelTrait) && (depth > 5))
+      if ((image->alpha_trait != UndefinedPixelTrait) && (depth > 5))
         depth--;
       if (IsImageGray(image,exception) != MagickFalse)
         depth=MaxTreeDepth;
diff --git a/MagickCore/resample.c b/MagickCore/resample.c
index ae6809c..99aac32 100644
--- a/MagickCore/resample.c
+++ b/MagickCore/resample.c
@@ -545,7 +545,7 @@
   pixel->red = pixel->green = pixel->blue = 0.0;
   if (pixel->colorspace == CMYKColorspace)
     pixel->black = 0.0;
-  if (pixel->alpha_trait == BlendPixelTrait)
+  if (pixel->alpha_trait != UndefinedPixelTrait)
     pixel->alpha = 0.0;
 
   /*
@@ -610,7 +610,7 @@
         pixel->alpha  += weight*GetPixelAlpha(resample_filter->image,pixels);
         divisor_m += weight;
 
-        if (pixel->alpha_trait == BlendPixelTrait)
+        if (pixel->alpha_trait != UndefinedPixelTrait)
           weight *= QuantumScale*((double) GetPixelAlpha(resample_filter->image,pixels));
         pixel->red   += weight*GetPixelRed(resample_filter->image,pixels);
         pixel->green += weight*GetPixelGreen(resample_filter->image,pixels);
diff --git a/MagickCore/resize.c b/MagickCore/resize.c
index d668536..4a17c28 100644
--- a/MagickCore/resize.c
+++ b/MagickCore/resize.c
@@ -1506,16 +1506,14 @@
   return((double *) resize_filter->coefficient);
 }
 
-MagickPrivate double GetResizeFilterBlur(
-  const ResizeFilter *resize_filter)
+MagickPrivate double GetResizeFilterBlur(const ResizeFilter *resize_filter)
 {
   assert(resize_filter != (ResizeFilter *) NULL);
   assert(resize_filter->signature == MagickSignature);
   return(resize_filter->blur);
 }
 
-MagickPrivate double GetResizeFilterScale(
-  const ResizeFilter *resize_filter)
+MagickPrivate double GetResizeFilterScale(const ResizeFilter *resize_filter)
 {
   assert(resize_filter != (ResizeFilter *) NULL);
   assert(resize_filter->signature == MagickSignature);
@@ -1546,8 +1544,7 @@
   return(resize_filter->windowWeightingType);
 }
 
-MagickPrivate double GetResizeFilterSupport(
-  const ResizeFilter *resize_filter)
+MagickPrivate double GetResizeFilterSupport(const ResizeFilter *resize_filter)
 {
   assert(resize_filter != (ResizeFilter *) NULL);
   assert(resize_filter->signature == MagickSignature);
@@ -2892,7 +2889,7 @@
       filter_type=PointFilter;
     else
       if ((image->storage_class == PseudoClass) ||
-          (image->alpha_trait == BlendPixelTrait) ||
+          (image->alpha_trait != UndefinedPixelTrait) ||
           ((x_factor*y_factor) > 1.0))
         filter_type=MitchellFilter;
   resize_filter=AcquireResizeFilter(image,filter_type,MagickFalse,exception);
@@ -3177,7 +3174,6 @@
 
   double
     alpha,
-    gamma,
     pixel[CompositePixelChannel],
     *scale_scanline,
     *scanline,
@@ -3457,11 +3453,10 @@
                   scanline[x*GetPixelChannels(image)+offset]),q);
                 continue;
               }
-            alpha=QuantumScale*scanline[x*GetPixelChannels(image)+
-              GetPixelChannelChannel(image,AlphaPixelChannel)];
-            gamma=PerceptibleReciprocal(alpha);
-            SetPixelChannel(scale_image,channel,ClampToQuantum(gamma*scanline[
-              x*GetPixelChannels(image)+offset]),q);
+            alpha=QuantumScale*scanline[x*GetPixelChannels(scale_image)+
+              GetPixelChannelChannel(scale_image,AlphaPixelChannel)];
+            SetPixelChannel(scale_image,channel,ClampToQuantum(scanline[
+              x*GetPixelChannels(scale_image)+offset]),q);
           }
           q+=GetPixelChannels(scale_image);
         }
@@ -3496,7 +3491,7 @@
               PixelTrait traits=GetPixelChannelTraits(image,channel);
               if (traits == UndefinedPixelTrait)
                 continue;
-              pixel[i]+=span.x*scanline[x*GetPixelChannels(image)+i];
+              pixel[i]+=span.x*scanline[x*GetPixelChannels(scale_image)+i];
               scale_scanline[n*MaxPixelChannels+channel]=pixel[i];
             }
             scale.x-=span.x;
@@ -3513,14 +3508,14 @@
                 next_column=MagickFalse;
               }
             for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
-              pixel[i]+=scale.x*scanline[x*GetPixelChannels(image)+i];
+              pixel[i]+=scale.x*scanline[x*GetPixelChannels(scale_image)+i];
             span.x-=scale.x;
           }
       }
       if (span.x > 0)
         {
           for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
-            pixel[i]+=span.x*scanline[(x-1)*GetPixelChannels(image)+i];
+            pixel[i]+=span.x*scanline[(x-1)*GetPixelChannels(scale_image)+i];
         }
       if ((next_column == MagickFalse) &&
           ((ssize_t) n < (ssize_t) scale_image->columns))
@@ -3672,7 +3667,7 @@
   if (thumbnail_image == (Image *) NULL)
     return(thumbnail_image);
   (void) ParseAbsoluteGeometry("0x0+0+0",&thumbnail_image->page);
-  if (thumbnail_image->alpha_trait != BlendPixelTrait)
+  if (thumbnail_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(thumbnail_image,OpaqueAlphaChannel,exception);
   thumbnail_image->depth=8;
   thumbnail_image->interlace=NoInterlace;
diff --git a/MagickCore/shear.c b/MagickCore/shear.c
index 02e31d3..6a555bc 100644
--- a/MagickCore/shear.c
+++ b/MagickCore/shear.c
@@ -1624,7 +1624,7 @@
       integral_image=DestroyImage(integral_image);
       return(integral_image);
     }
-  if (integral_image->alpha_trait != BlendPixelTrait)
+  if (integral_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(integral_image,OpaqueAlphaChannel,exception);
   /*
     Compute image size.
@@ -1648,7 +1648,7 @@
   /*
     Shear the image.
   */
-  if (shear_image->alpha_trait != BlendPixelTrait)
+  if (shear_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(shear_image,OpaqueAlphaChannel,exception);
   status=XShearImage(shear_image,shear.x,image->columns,image->rows,bounds.x,
     (ssize_t) (shear_image->rows-image->rows)/2,exception);
@@ -1769,7 +1769,7 @@
       integral_image=DestroyImage(integral_image);
       return(integral_image);
     }
-  if (integral_image->alpha_trait != BlendPixelTrait)
+  if (integral_image->alpha_trait == UndefinedPixelTrait)
     (void) SetImageAlphaChannel(integral_image,OpaqueAlphaChannel,exception);
   /*
     Compute maximum bounds for 3 shear operations.
diff --git a/MagickCore/transform.c b/MagickCore/transform.c
index 065f9e3..c3fee33 100644
--- a/MagickCore/transform.c
+++ b/MagickCore/transform.c
@@ -1749,8 +1749,8 @@
   if ((IsPixelInfoGray(&splice_image->background_color) == MagickFalse) &&
       (IsGrayColorspace(splice_image->colorspace) != MagickFalse))
     (void) SetImageColorspace(splice_image,sRGBColorspace,exception);
-  if ((splice_image->background_color.alpha_trait == BlendPixelTrait) &&
-      (splice_image->alpha_trait != BlendPixelTrait))
+  if ((splice_image->background_color.alpha_trait != UndefinedPixelTrait) &&
+      (splice_image->alpha_trait == UndefinedPixelTrait))
     (void) SetImageAlpha(splice_image,OpaqueAlpha,exception);
   (void) SetImageBackgroundColor(splice_image,exception);
   /*
diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c
index 866c965..b41f837 100644
--- a/MagickCore/xwindow.c
+++ b/MagickCore/xwindow.c
@@ -697,7 +697,7 @@
   (void) XParseGeometry(annotate_info->geometry,&x,&y,&width,&height);
   alpha_trait=image->alpha_trait;
   (void) CompositeImage(image,annotate_image,
-    annotate_image->alpha_trait == BlendPixelTrait ? OverCompositeOp :
+    annotate_image->alpha_trait != UndefinedPixelTrait ? OverCompositeOp :
     CopyCompositeOp,MagickTrue,(ssize_t) x,(ssize_t) y,exception);
   image->alpha_trait=alpha_trait;
   annotate_image=DestroyImage(annotate_image);
@@ -5728,7 +5728,7 @@
   window->ximage=ximage;
   matte_image=(XImage *) NULL;
   if ((window->shape != MagickFalse) && (window->image != (Image *) NULL))
-    if ((window->image->alpha_trait == BlendPixelTrait) &&
+    if ((window->image->alpha_trait != UndefinedPixelTrait) &&
         ((int) width <= XDisplayWidth(display,window->screen)) &&
         ((int) height <= XDisplayHeight(display,window->screen)))
       {
@@ -5914,7 +5914,7 @@
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   canvas=image;
   if ((window->immutable == MagickFalse) &&
-      (image->storage_class == DirectClass) && (image->alpha_trait == BlendPixelTrait))
+      (image->storage_class == DirectClass) && (image->alpha_trait != UndefinedPixelTrait))
     {
       char
         size[MaxTextExtent];
@@ -6530,7 +6530,7 @@
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   canvas=image;
   if ((window->immutable != MagickFalse) &&
-      (image->storage_class == DirectClass) && (image->alpha_trait == BlendPixelTrait))
+      (image->storage_class == DirectClass) && (image->alpha_trait != UndefinedPixelTrait))
     {
       char
         size[MaxTextExtent];
@@ -7514,7 +7514,7 @@
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&pixel,BlackPixelChannel,X11Compliance,tuple);
     }
-  if (pixel.alpha_trait == BlendPixelTrait)
+  if (pixel.alpha_trait != UndefinedPixelTrait)
     {
       (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
       ConcatenateColorComponent(&pixel,AlphaPixelChannel,X11Compliance,tuple);
@@ -7771,7 +7771,7 @@
       number_colors=(unsigned int) (map_info->base_pixel+
         (map_info->red_max+1)*(map_info->green_max+1)*(map_info->blue_max+1));
       if ((map_info->red_max*map_info->green_max*map_info->blue_max) != 0)
-        if ((image->alpha_trait != BlendPixelTrait) &&
+        if ((image->alpha_trait == UndefinedPixelTrait) &&
             (resource_info->color_recovery == MagickFalse) &&
             (resource_info->quantize_info->dither_method != NoDitherMethod) &&
             (number_colors < MaxColormapSize))
diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs
index 7f5901f..c867d84 100644
--- a/PerlMagick/Magick.xs
+++ b/PerlMagick/Magick.xs
@@ -4202,7 +4202,7 @@
         ChannelFeatures(BlueChannel,i);
         if (image->colorspace == CMYKColorspace)
           ChannelFeatures(BlackChannel,i);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           ChannelFeatures(AlphaChannel,i);
       }
       channel_features=(ChannelFeatures *)
@@ -5324,7 +5324,7 @@
           if (LocaleCompare(attribute,"matte") == 0)
             {
               if (image != (Image *) NULL)
-                s=newSViv((ssize_t) image->alpha_trait == BlendPixelTrait ?
+                s=newSViv((ssize_t) image->alpha_trait != UndefinedPixelTrait ?
                   1 : 0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -6640,12 +6640,12 @@
         goto PerlException;
       }
     map="RGB";
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       map="RGBA";
     if (image->colorspace == CMYKColorspace)
       {
         map="CMYK";
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           map="CMYKA";
       }
     normalize=MagickFalse;
@@ -8154,8 +8154,8 @@
             {
               QueryColorCompliance(argument_list[1].string_reference,
                 AllCompliance,&image->background_color,exception);
-              if ((image->background_color.alpha_trait == BlendPixelTrait) &&
-                  (image->alpha_trait != BlendPixelTrait))
+              if ((image->background_color.alpha_trait != UndefinedPixelTrait) &&
+                  (image->alpha_trait == UndefinedPixelTrait))
                 (void) SetImageAlpha(image,OpaqueAlpha,exception);
             }
           image=RotateImage(image,argument_list[0].real_reference,exception);
@@ -8619,7 +8619,7 @@
                   opacity=(Quantum) StringToDoubleInterval(
                     argument_list[6].string_reference,(double) QuantumRange+
                     1.0);
-                  if (composite_image->alpha_trait == BlendPixelTrait)
+                  if (composite_image->alpha_trait != UndefinedPixelTrait)
                     (void) SetImageAlpha(composite_image,OpaqueAlpha,exception);
                   composite_view=AcquireAuthenticCacheView(composite_image,exception);
                   for (y=0; y < (ssize_t) composite_image->rows ; y++)
@@ -9112,7 +9112,7 @@
             geometry.x=argument_list[1].integer_reference;
           if (attribute_flag[2] != 0)
             geometry.y=argument_list[2].integer_reference;
-          if (image->alpha_trait != BlendPixelTrait)
+          if (image->alpha_trait == UndefinedPixelTrait)
             (void) SetImageAlpha(image,OpaqueAlpha,exception);
           (void) GetOneVirtualPixelInfo(image,UndefinedVirtualPixelMethod,
             geometry.x,geometry.y,&target,exception);
@@ -12286,7 +12286,7 @@
       PUSHs(sv_2mortal(newSViv((size_t) floor(color.blue+0.5))));
       if (color.colorspace == CMYKColorspace)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.black+0.5))));
-      if (color.alpha_trait == BlendPixelTrait)
+      if (color.alpha_trait != UndefinedPixelTrait)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.alpha+0.5))));
     }
 
@@ -14280,7 +14280,7 @@
       ChannelStatistics(BlueChannel);
       if (image->colorspace == CMYKColorspace)
         ChannelStatistics(BlackChannel);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         ChannelStatistics(AlphaChannel);
       channel_statistics=(ChannelStatistics *)
         RelinquishMagickMemory(channel_statistics);
diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in
index 7e0096a..096a504 100644
--- a/PerlMagick/quantum/quantum.xs.in
+++ b/PerlMagick/quantum/quantum.xs.in
@@ -4202,7 +4202,7 @@
         ChannelFeatures(BlueChannel,i);
         if (image->colorspace == CMYKColorspace)
           ChannelFeatures(BlackChannel,i);
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           ChannelFeatures(AlphaChannel,i);
       }
       channel_features=(ChannelFeatures *)
@@ -5324,7 +5324,7 @@
           if (LocaleCompare(attribute,"matte") == 0)
             {
               if (image != (Image *) NULL)
-                s=newSViv((ssize_t) image->alpha_trait == BlendPixelTrait ?
+                s=newSViv((ssize_t) image->alpha_trait != UndefinedPixelTrait ?
                   1 : 0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -6640,12 +6640,12 @@
         goto PerlException;
       }
     map="RGB";
-    if (image->alpha_trait == BlendPixelTrait)
+    if (image->alpha_trait != UndefinedPixelTrait)
       map="RGBA";
     if (image->colorspace == CMYKColorspace)
       {
         map="CMYK";
-        if (image->alpha_trait == BlendPixelTrait)
+        if (image->alpha_trait != UndefinedPixelTrait)
           map="CMYKA";
       }
     normalize=MagickFalse;
@@ -8154,8 +8154,8 @@
             {
               QueryColorCompliance(argument_list[1].string_reference,
                 AllCompliance,&image->background_color,exception);
-              if ((image->background_color.alpha_trait == BlendPixelTrait) &&
-                  (image->alpha_trait != BlendPixelTrait))
+              if ((image->background_color.alpha_trait != UndefinedPixelTrait) &&
+                  (image->alpha_trait == UndefinedPixelTrait))
                 (void) SetImageAlpha(image,OpaqueAlpha,exception);
             }
           image=RotateImage(image,argument_list[0].real_reference,exception);
@@ -8619,7 +8619,7 @@
                   opacity=(Quantum) StringToDoubleInterval(
                     argument_list[6].string_reference,(double) QuantumRange+
                     1.0);
-                  if (composite_image->alpha_trait == BlendPixelTrait)
+                  if (composite_image->alpha_trait != UndefinedPixelTrait)
                     (void) SetImageAlpha(composite_image,OpaqueAlpha,exception);
                   composite_view=AcquireAuthenticCacheView(composite_image,exception);
                   for (y=0; y < (ssize_t) composite_image->rows ; y++)
@@ -9112,7 +9112,7 @@
             geometry.x=argument_list[1].integer_reference;
           if (attribute_flag[2] != 0)
             geometry.y=argument_list[2].integer_reference;
-          if (image->alpha_trait != BlendPixelTrait)
+          if (image->alpha_trait == UndefinedPixelTrait)
             (void) SetImageAlpha(image,OpaqueAlpha,exception);
           (void) GetOneVirtualPixelInfo(image,UndefinedVirtualPixelMethod,
             geometry.x,geometry.y,&target,exception);
@@ -12284,7 +12284,7 @@
       PUSHs(sv_2mortal(newSViv((size_t) floor(color.blue+0.5))));
       if (color.colorspace == CMYKColorspace)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.black+0.5))));
-      if (color.alpha_trait == BlendPixelTrait)
+      if (color.alpha_trait != UndefinedPixelTrait)
         PUSHs(sv_2mortal(newSViv((size_t) floor(color.alpha+0.5))));
     }
 
@@ -14278,7 +14278,7 @@
       ChannelStatistics(BlueChannel);
       if (image->colorspace == CMYKColorspace)
         ChannelStatistics(BlackChannel);
-      if (image->alpha_trait == BlendPixelTrait)
+      if (image->alpha_trait != UndefinedPixelTrait)
         ChannelStatistics(AlphaChannel);
       channel_statistics=(ChannelStatistics *)
         RelinquishMagickMemory(channel_statistics);
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)