diff --git a/MagickCore/decorate.c b/MagickCore/decorate.c
index 4771b9e..6f12c2c 100644
--- a/MagickCore/decorate.c
+++ b/MagickCore/decorate.c
@@ -185,6 +185,7 @@
 
   PixelInfo
     accentuate,
+    border,
     highlight,
     interior,
     matte,
@@ -240,39 +241,39 @@
   /*
     Initialize 3D effects color.
   */
-  interior=image->border_color;
-  matte=image->matte_color;
-  accentuate=matte;
+  GetPixelInfo(frame_image,&interior);
+  SetPixelInfoPacket(frame_image,&image->border_color,&interior);
+  GetPixelInfo(frame_image,&matte);
+  matte.colorspace=RGBColorspace;
+  SetPixelInfoPacket(frame_image,&image->matte_color,&matte);
+  GetPixelInfo(frame_image,&border);
+  border.colorspace=RGBColorspace;
+  SetPixelInfoPacket(frame_image,&image->border_color,&border);
+  GetPixelInfo(frame_image,&accentuate);
   accentuate.red=(MagickRealType) (QuantumScale*((QuantumRange-
     AccentuateModulate)*matte.red+(QuantumRange*AccentuateModulate)));
   accentuate.green=(MagickRealType) (QuantumScale*((QuantumRange-
     AccentuateModulate)*matte.green+(QuantumRange*AccentuateModulate)));
   accentuate.blue=(MagickRealType) (QuantumScale*((QuantumRange-
     AccentuateModulate)*matte.blue+(QuantumRange*AccentuateModulate)));
-  accentuate.black=(MagickRealType) (QuantumScale*((QuantumRange-
-    AccentuateModulate)*matte.black+(QuantumRange*AccentuateModulate)));
   accentuate.alpha=matte.alpha;
-  highlight=matte;
+  GetPixelInfo(frame_image,&highlight);
   highlight.red=(MagickRealType) (QuantumScale*((QuantumRange-
     HighlightModulate)*matte.red+(QuantumRange*HighlightModulate)));
   highlight.green=(MagickRealType) (QuantumScale*((QuantumRange-
     HighlightModulate)*matte.green+(QuantumRange*HighlightModulate)));
   highlight.blue=(MagickRealType) (QuantumScale*((QuantumRange-
     HighlightModulate)*matte.blue+(QuantumRange*HighlightModulate)));
-  highlight.black=(MagickRealType) (QuantumScale*((QuantumRange-
-    HighlightModulate)*matte.black+(QuantumRange*HighlightModulate)));
   highlight.alpha=matte.alpha;
-  shadow=matte;
+  GetPixelInfo(frame_image,&shadow);
   shadow.red=QuantumScale*matte.red*ShadowModulate;
   shadow.green=QuantumScale*matte.green*ShadowModulate;
   shadow.blue=QuantumScale*matte.blue*ShadowModulate;
-  shadow.black=QuantumScale*matte.black*ShadowModulate;
   shadow.alpha=matte.alpha;
-  trough=matte;
+  GetPixelInfo(frame_image,&trough);
   trough.red=QuantumScale*matte.red*TroughModulate;
   trough.green=QuantumScale*matte.green*TroughModulate;
   trough.blue=QuantumScale*matte.blue*TroughModulate;
-  trough.black=QuantumScale*matte.black*TroughModulate;
   trough.alpha=matte.alpha;
   status=MagickTrue;
   progress=0;
diff --git a/MagickCore/distort.c b/MagickCore/distort.c
index 5d1be36..b934e1b 100644
--- a/MagickCore/distort.c
+++ b/MagickCore/distort.c
@@ -2311,7 +2311,10 @@
       */
       validity = 1.0;
 
-      invalid=distort_image->matte_color;
+      GetPixelInfo(distort_image,&invalid);
+      SetPixelInfoPacket(distort_image,&distort_image->matte_color,&invalid);
+      if (distort_image->colorspace == CMYKColorspace)
+        ConvertRGBToCMYK(&invalid);   /* what about other color spaces? */
       for (i=0; i < (ssize_t) distort_image->columns; i++)
       {
         /* map pixel coordinate to distortion space coordinate */
diff --git a/MagickCore/histogram.c b/MagickCore/histogram.c
index 816268b..af17ac2 100644
--- a/MagickCore/histogram.c
+++ b/MagickCore/histogram.c
@@ -257,7 +257,7 @@
       }
       for (i=0; i < (ssize_t) node_info->number_unique; i++)
       {
-        target=node_info->list[i];
+        SetPixelInfoPacket(image,&node_info->list[i],&target);
         if (IsPixelInfoEquivalent(&pixel,&target) != MagickFalse)
           break;
       }
@@ -725,7 +725,7 @@
         break;
       for (i=0; i < (ssize_t) node_info->number_unique; i++)
       {
-        target=node_info->list[i];
+        SetPixelInfoPacket(image,&node_info->list[i],&target);
         if (IsPixelInfoEquivalent(&pixel,&target) != MagickFalse)
           break;
       }
@@ -885,7 +885,7 @@
         break;
       for (i=0; i < (ssize_t) node_info->number_unique; i++)
       {
-        target=node_info->list[i];
+        SetPixelInfoPacket(image,&node_info->list[i],&target);
         if (IsPixelInfoEquivalent(&pixel,&target) != MagickFalse)
           break;
       }
@@ -1134,7 +1134,7 @@
   status=MagickTrue;
   for (i=0; i < (ssize_t) number_colors; i++)
   {
-    pixel=(*p);
+    SetPixelInfoPacket(image,p,&pixel);
     (void) CopyMagickString(tuple,"(",MaxTextExtent);
     ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,tuple);
     (void) ConcatenateMagickString(tuple,",",MaxTextExtent);
diff --git a/MagickCore/identify.c b/MagickCore/identify.c
index d6d7501..ba1c16d 100644
--- a/MagickCore/identify.c
+++ b/MagickCore/identify.c
@@ -647,7 +647,7 @@
           p=image->colormap;
           for (i=0; i < (ssize_t) image->colors; i++)
           {
-            pixel=(*p);
+            SetPixelInfoPacket(image,p,&pixel);
             (void) CopyMagickString(tuple,"(",MaxTextExtent);
             ConcatenateColorComponent(&pixel,RedPixelChannel,X11Compliance,
               tuple);
diff --git a/MagickCore/image.c b/MagickCore/image.c
index 742d480..c31f1a3 100644
--- a/MagickCore/image.c
+++ b/MagickCore/image.c
@@ -2433,6 +2433,9 @@
       PixelInfo
         background;
 
+      PixelInfo
+        pixel;
+
       ssize_t
         y;
 
@@ -2443,7 +2446,9 @@
         break;
       if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
         break;
-      background=image->background_color;
+      GetPixelInfo(image,&background);
+      SetPixelInfoPacket(image,&image->background_color,&background);
+      SetPacketPixelInfo(image,&background,&pixel);
       image_view=AcquireCacheView(image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
       #pragma omp parallel for schedule(dynamic,4) shared(status)
@@ -2501,7 +2506,8 @@
           /*
             Reset all color channels to background color.
           */
-          background=image->background_color;
+          GetPixelInfo(image,&background);
+          SetPixelInfoPacket(image,&(image->background_color),&background);
           (void) LevelImageColors(image,&background,&background,MagickTrue,
             exception);
         }
@@ -2583,6 +2589,9 @@
   PixelInfo
     background;
 
+  PixelInfo
+    pixel;
+
   ssize_t
     y;
 
@@ -2595,11 +2604,13 @@
   if (image->background_color.alpha != OpaqueAlpha)
     image->matte=MagickTrue;
   GetPixelInfo(image,&background);
-  background=image->background_color;
+  SetPixelInfoPacket(image,&image->background_color,&background);
+  SetPacketPixelInfo(image,&background,&pixel);
   /*
     Set image background color.
   */
   status=MagickTrue;
+  pixel.black=0;
   image_view=AcquireCacheView(image);
   for (y=0; y < (ssize_t) image->rows; y++)
   {
diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h
index 1bf8a49..cc7a5e5 100644
--- a/MagickCore/magick-config.h
+++ b/MagickCore/magick-config.h
@@ -441,15 +441,15 @@
 #endif
 
 /* Define if you have the <lcms2.h> header file. */
-/* #undef HAVE_LCMS2_H */
+#ifndef MAGICKCORE_HAVE_LCMS2_H
+#define MAGICKCORE_HAVE_LCMS2_H 1
+#endif
 
 /* Define if you have the <lcms2/lcms2.h> header file. */
 /* #undef HAVE_LCMS2_LCMS2_H */
 
 /* Define if you have the <lcms.h> header file. */
-#ifndef MAGICKCORE_HAVE_LCMS_H
-#define MAGICKCORE_HAVE_LCMS_H 1
-#endif
+/* #undef HAVE_LCMS_H */
 
 /* Define if you have the <lcms/lcms.h> header file. */
 /* #undef HAVE_LCMS_LCMS_H */
@@ -1208,9 +1208,7 @@
 #endif
 
 /* Define if you have LQR library */
-#ifndef MAGICKCORE_LQR_DELEGATE
-#define MAGICKCORE_LQR_DELEGATE 1
-#endif
+/* #undef LQR_DELEGATE */
 
 /* Define if using libltdl to support dynamically loadable modules */
 #ifndef MAGICKCORE_LTDL_DELEGATE
@@ -1222,7 +1220,7 @@
 
 /* Define to the system default library search path. */
 #ifndef MAGICKCORE_LT_DLSEARCH_PATH
-#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/opt/intel/lib/intel64:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/qt-3.3/lib:/usr/lib64/tracker-0.12:/usr/lib64/xulrunner-2"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/alliance/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/kicad:/usr/lib/llvm:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mpich2/lib/:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/octave/3.4.2:/usr/lib64/openmotif:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2"
 #endif
 
 /* The archive extension */
@@ -1484,9 +1482,7 @@
 #endif
 
 /* Define if you have WEBP library */
-#ifndef MAGICKCORE_WEBP_DELEGATE
-#define MAGICKCORE_WEBP_DELEGATE 1
-#endif
+/* #undef WEBP_DELEGATE */
 
 /* Define to use the Windows GDI32 library */
 /* #undef WINGDI32_DELEGATE */
@@ -1553,7 +1549,9 @@
 /* #undef _MINIX */
 
 /* Define this for the OpenCL Accelerator */
-/* #undef _OPENCL */
+#ifndef MAGICKCORE__OPENCL
+#define MAGICKCORE__OPENCL 1
+#endif
 
 /* Define to 2 if the system does not provide POSIX.1 features except with
    this defined. */
diff --git a/MagickCore/paint.c b/MagickCore/paint.c
index 5dc2bd3..5d13857 100644
--- a/MagickCore/paint.c
+++ b/MagickCore/paint.c
@@ -335,7 +335,7 @@
       if (GetPixelAlpha(floodplane_image,p) != OpaqueAlpha)
         {
           (void) GetFillColor(draw_info,x,y,&fill_color,exception);
-          fill=fill_color;
+          SetPixelInfoPacket(image,&fill_color,&fill);
           if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
             SetPixelRed(image,ClampToQuantum(fill.red),q);
           if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
@@ -456,9 +456,9 @@
     sizeof(*gradient->stops));
   for (i=0; i < (ssize_t) gradient->number_stops; i++)
     GetPixelInfo(image,&gradient->stops[i].color);
-  gradient->stops[0].color=(*start_color);
+  SetPixelInfoPacket(image,start_color,&gradient->stops[0].color);
   gradient->stops[0].offset=0.0;
-  gradient->stops[1].color=(*stop_color);
+  SetPixelInfoPacket(image,stop_color,&gradient->stops[1].color);
   gradient->stops[1].offset=1.0;
   /*
     Draw a gradient on the image.
diff --git a/MagickCore/pixel-accessor.h b/MagickCore/pixel-accessor.h
index 8720997..c480fd6 100644
--- a/MagickCore/pixel-accessor.h
+++ b/MagickCore/pixel-accessor.h
@@ -525,6 +525,19 @@
       pixel[image->channel_map[IndexPixelChannel].channel];
 }
 
+static inline void SetPixelInfoPacket(const Image *image,
+  const PixelInfo *pixel,PixelInfo *pixel_info)
+{
+  pixel_info->red=(MagickRealType) pixel->red;
+  pixel_info->green=(MagickRealType) pixel->green;
+  pixel_info->blue=(MagickRealType) pixel->blue;
+  pixel_info->alpha=(MagickRealType) pixel->alpha;
+  if (image->colorspace == CMYKColorspace)
+    pixel_info->black=(MagickRealType) pixel->black;
+  if (image->storage_class == PseudoClass)
+    pixel_info->index=(MagickRealType) pixel->index;
+}
+
 static inline void SetPixelMagenta(const Image *image,const Quantum magenta,
   Quantum *pixel)
 {
diff --git a/MagickCore/shear.c b/MagickCore/shear.c
index 7377f59..384faee 100644
--- a/MagickCore/shear.c
+++ b/MagickCore/shear.c
@@ -1480,7 +1480,8 @@
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  background=image->background_color;
+  GetPixelInfo(image,&background);
+  SetPixelInfoPacket(image,&image->background_color,&background);
   /*
     X shear image.
   */
@@ -1695,7 +1696,8 @@
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  background=image->background_color;
+  GetPixelInfo(image,&background);
+  SetPixelInfoPacket(image,&image->background_color,&background);
   /*
     Y Shear image.
   */
diff --git a/MagickWand/drawing-wand.c b/MagickWand/drawing-wand.c
index 8827cda..5aa037b 100644
--- a/MagickWand/drawing-wand.c
+++ b/MagickWand/drawing-wand.c
@@ -2464,17 +2464,17 @@
   if (child != (XMLTreeInfo *) NULL)
     {
       if (CurrentContext->fill.alpha != OpaqueAlpha)
-        pixel.matte=CurrentContext->fill.alpha != OpaqueAlpha ? MagickTrue :
-          MagickFalse;
-      pixel=CurrentContext->fill;
+        pixel.matte=CurrentContext->fill.alpha != OpaqueAlpha ?
+          MagickTrue : MagickFalse;
+      SetPixelInfoPacket(wand->image,&CurrentContext->fill,&pixel);
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
   child=AddChildToXMLTree(xml_info,"fill-alpha",0);
   if (child != (XMLTreeInfo *) NULL)
     {
-      (void) FormatLocaleString(value,MaxTextExtent,"%g",(double) QuantumScale*
-        CurrentContext->fill.alpha);
+      (void) FormatLocaleString(value,MaxTextExtent,"%g",
+        (double) QuantumScale*CurrentContext->fill.alpha);
       (void) SetXMLTreeContent(child,value);
     }
   child=AddChildToXMLTree(xml_info,"fill-rule",0);
@@ -2532,7 +2532,7 @@
       if (CurrentContext->stroke.alpha != OpaqueAlpha)
         pixel.matte=CurrentContext->stroke.alpha != OpaqueAlpha ?
           MagickTrue : MagickFalse;
-      pixel=CurrentContext->stroke;
+      SetPixelInfoPacket(wand->image,&CurrentContext->stroke,&pixel);
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
@@ -2625,7 +2625,7 @@
       if (CurrentContext->undercolor.alpha != OpaqueAlpha)
         pixel.matte=CurrentContext->undercolor.alpha != OpaqueAlpha ?
           MagickTrue : MagickFalse;
-      pixel=CurrentContext->undercolor;
+      SetPixelInfoPacket(wand->image,&CurrentContext->undercolor,&pixel);
       GetColorTuple(&pixel,MagickTrue,value);
       (void) SetXMLTreeContent(child,value);
     }
diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c
index c70f7be..b73476e 100644
--- a/MagickWand/mogrify.c
+++ b/MagickWand/mogrify.c
@@ -678,7 +678,7 @@
   quantize_info=AcquireQuantizeInfo(mogrify_info);
   SetGeometryInfo(&geometry_info);
   GetPixelInfo(*image,&fill);
-  fill=(*image)->background_color;
+  SetPixelInfoPacket(*image,&(*image)->background_color,&fill);
   attenuate=1.0;
   compose=(*image)->compose;
   interpolate_method=UndefinedInterpolatePixel;
diff --git a/coders/avs.c b/coders/avs.c
index 9705443..54eb1e8 100644
--- a/coders/avs.c
+++ b/coders/avs.c
@@ -141,6 +141,7 @@
   /*
     Read AVS X image.
   */
+  image->matte=MagickTrue;
   width=ReadBlobMSBLong(image);
   height=ReadBlobMSBLong(image);
   if (EOFBlob(image) != MagickFalse)
@@ -152,7 +153,6 @@
     /*
       Convert AVS raster image to pixel packets.
     */
-    image->matte=MagickTrue;
     image->columns=width;
     image->rows=height;
     image->depth=8;
diff --git a/coders/palm.c b/coders/palm.c
index 8baf541..fd1fa99 100644
--- a/coders/palm.c
+++ b/coders/palm.c
@@ -513,7 +513,8 @@
     if (flags & PALM_HAS_TRANSPARENCY_FLAG)
       {
         if (bits_per_pixel != 16)
-          transpix=image->colormap[mask-transparentIndex];
+          SetPixelInfoPacket(image,image->colormap+(mask-transparentIndex),
+            &transpix);
         (void) TransparentPaintImage(image,&transpix,(Quantum) TransparentAlpha,
           MagickFalse,exception);
       }