]> granicus.if.org Git - imagemagick/blobdiff - PerlMagick/Magick.xs
(no commit message)
[imagemagick] / PerlMagick / Magick.xs
index e4ebb7560f2bbc0ae1de2734800462f4d6d518af..2dc94d6a1ce3263471a940188c3541d10de7bdf8 100644 (file)
@@ -206,15 +206,16 @@ static struct
   {
     { "Comment", { {"comment", StringReference} } },
     { "Label", { {"label", StringReference} } },
-    { "AddNoise", { {"noise", MagickNoiseOptions},
+    { "AddNoise", { {"noise", MagickNoiseOptions}, {"attenuate", RealReference},
       {"channel", MagickChannelOptions} } },
-    { "Colorize", { {"fill", StringReference}, {"opacity", StringReference} } },
+    { "Colorize", { {"fill", StringReference}, {"blend", StringReference} } },
     { "Border", { {"geometry", StringReference}, {"width", IntegerReference},
       {"height", IntegerReference}, {"fill", StringReference},
       {"bordercolor", StringReference}, {"color", StringReference},
       {"compose", MagickComposeOptions} } },
     { "Blur", { {"geometry", StringReference}, {"radius", RealReference},
-      {"sigma", RealReference}, {"channel", MagickChannelOptions} } },
+      {"sigma", RealReference}, {"bias", RealReference},
+      {"channel", MagickChannelOptions} } },
     { "Chop", { {"geometry", StringReference}, {"width", IntegerReference},
       {"height", IntegerReference}, {"x", IntegerReference},
       {"y", IntegerReference} } },
@@ -255,11 +256,13 @@ static struct
     { "Shade", { {"geometry", StringReference}, {"azimuth", RealReference},
       {"elevation", RealReference}, {"gray", MagickBooleanOptions} } },
     { "Sharpen", { {"geometry", StringReference}, {"radius", RealReference},
-      {"sigma", RealReference}, {"channel", MagickChannelOptions} } },
+      {"sigma", RealReference}, {"bias", RealReference},
+      {"channel", MagickChannelOptions} } },
     { "Shear", { {"geometry", StringReference}, {"x", RealReference},
       {"y", RealReference}, { "fill", StringReference},
       {"color", StringReference} } },
-    { "Spread", { {"radius", RealReference} } },
+    { "Spread", { {"radius", RealReference},
+      {"interpolate", MagickInterpolateOptions} } },
     { "Swirl", { {"degrees", RealReference},
       {"interpolate", MagickInterpolateOptions} } },
     { "Resize", { {"geometry", StringReference}, {"width", IntegerReference},
@@ -367,7 +370,7 @@ static struct
     { "Threshold", { {"threshold", StringReference},
       {"channel", MagickChannelOptions} } },
     { "Charcoal", { {"geometry", StringReference}, {"radius", RealReference},
-      {"sigma", RealReference} } },
+      {"sigma", RealReference}, {"biabias", RealReference} } },
     { "Trim", { {"fuzz", StringReference} } },
     { "Wave", { {"geometry", StringReference}, {"amplitude", RealReference},
       {"wavelength", RealReference},
@@ -380,7 +383,7 @@ static struct
     { "Deconstruct", },
     { "GaussianBlur", { {"geometry", StringReference},
       {"radius", RealReference}, {"sigma", RealReference},
-      {"channel", MagickChannelOptions} } },
+      {"bias", RealReference}, {"channel", MagickChannelOptions} } },
     { "Convolve", { {"coefficients", ArrayReference},
       {"channel", MagickChannelOptions}, {"bias", StringReference},
       {"kernel", StringReference} } },
@@ -393,7 +396,8 @@ static struct
       {"channel", MagickChannelOptions} } },
     { "MotionBlur", { {"geometry", StringReference},
       {"radius", RealReference}, {"sigma", RealReference},
-      {"angle", RealReference}, {"channel", MagickChannelOptions} } },
+      {"angle", RealReference}, {"bias", RealReference},
+      {"channel", MagickChannelOptions} } },
     { "OrderedDither", { {"threshold", StringReference},
       {"channel", MagickChannelOptions} } },
     { "Shave", { {"geometry", StringReference}, {"width", IntegerReference},
@@ -420,11 +424,11 @@ static struct
     { "WhiteThreshold", { {"threshold", StringReference},
       {"channel", MagickChannelOptions} } },
     { "RadialBlur", { {"geometry", StringReference}, {"angle", RealReference},
-      {"channel", MagickChannelOptions} } },
+      {"bias", RealReference}, {"channel", MagickChannelOptions} } },
     { "Thumbnail", { {"geometry", StringReference}, {"width", IntegerReference},
       {"height", IntegerReference} } },
     { "Strip", },
-    { "Tint", { {"fill", StringReference}, {"opacity", StringReference} } },
+    { "Tint", { {"fill", StringReference}, {"blend", StringReference} } },
     { "Channel", { {"channel", MagickChannelOptions} } },
     { "Splice", { {"geometry", StringReference}, {"width", IntegerReference},
       {"height", IntegerReference}, {"x", IntegerReference},
@@ -455,31 +459,32 @@ static struct
     { "Sans1", },
     { "AdaptiveSharpen", { {"geometry", StringReference},
       {"radius", RealReference}, {"sigma", RealReference},
-      {"channel", MagickChannelOptions} } },
+      {"bias", RealReference}, {"channel", MagickChannelOptions} } },
     { "Transpose", },
     { "Transverse", },
     { "AutoOrient", },
     { "AdaptiveBlur", { {"geometry", StringReference},
       {"radius", RealReference}, {"sigma", RealReference},
-      {"channel", MagickChannelOptions} } },
+      {"bias", RealReference}, {"channel", MagickChannelOptions} } },
     { "Sketch", { {"geometry", StringReference},
       {"radius", RealReference}, {"sigma", RealReference},
-      {"angle", RealReference} } },
+      {"angle", RealReference}, {"bias", RealReference} } },
     { "UniqueColors", },
     { "AdaptiveResize", { {"geometry", StringReference},
       {"width", IntegerReference}, {"height", IntegerReference},
       {"filter", MagickFilterOptions}, {"support", StringReference },
-      {"blur", RealReference } } },
+      {"blur", RealReference }, {"interpolate", MagickInterpolateOptions} } },
     { "ClipMask", { {"mask", ImageReference} } },
     { "LinearStretch", { {"levels", StringReference},
       {"black-point", RealReference},{"white-point", RealReference} } },
-    { "Recolor", { {"matrix", ArrayReference} } },
+    { "ColorMatrix", { {"matrix", ArrayReference} } },
     { "Mask", { {"mask", ImageReference} } },
     { "Polaroid", { {"caption", StringReference}, {"angle", RealReference},
       {"font", StringReference}, {"stroke", StringReference},
       {"fill", StringReference}, {"strokewidth", RealReference},
       {"pointsize", RealReference}, {"gravity", MagickGravityOptions},
-      {"background", StringReference} } },
+      {"background", StringReference},
+      {"interpolate", MagickInterpolateOptions} } },
     { "FloodfillPaint", { {"geometry", StringReference},
       {"x", IntegerReference}, {"y", IntegerReference},
       {"fill", StringReference}, {"bordercolor", StringReference},
@@ -489,6 +494,7 @@ static struct
       {"virtual-pixel", MagickVirtualPixelOptions},
       {"best-fit", MagickBooleanOptions} } },
     { "Clut", { {"image", ImageReference},
+      {"interpolate", MagickInterpolateOptions},
       {"channel", MagickChannelOptions} } },
     { "LiquidRescale", { {"geometry", StringReference},
       {"width", IntegerReference}, {"height", IntegerReference},
@@ -508,7 +514,8 @@ static struct
       {"virtual-pixel", MagickVirtualPixelOptions} } },
     { "SelectiveBlur", { {"geometry", StringReference},
       {"radius", RealReference}, {"sigma", RealReference},
-      {"threshold", RealReference}, {"channel", MagickChannelOptions} } },
+      {"threshold", RealReference}, {"bias", RealReference},
+      {"channel", MagickChannelOptions} } },
     { "HaldClut", { {"image", ImageReference},
       {"channel", MagickChannelOptions} } },
     { "BlueShift", { {"factor", StringReference} } },
@@ -528,7 +535,7 @@ static struct
     { "Morphology", { {"kernel", StringReference},
       {"channel", MagickChannelOptions}, {"method", MagickMorphologyOptions},
       {"iterations", IntegerReference} } },
-    { "ColorMatrix", { {"matrix", ArrayReference} } },
+    { "Sans", { {"matrix", ArrayReference} } },
     { "Color", { {"color", StringReference} } },
     { "Mode", { {"geometry", StringReference},
       {"width", IntegerReference},{"height", IntegerReference},
@@ -1019,32 +1026,37 @@ static struct PackageInfo *GetPackageInfo(pTHX_ void *reference,
 %
 */
 
-static double SiPrefixToDouble(const char *string,const double interval)
+static double SiPrefixToDoubleInterval(const char *string,const double interval)
+{
+  char
+    *q;
+
+  double
+    value;
+
+  value=InterpretSiPrefixValue(string,&q);
+  if (*q == '%')
+    value*=interval/100.0;
+  return(value);
+}
+
+static inline double StringToDouble(const char *restrict string,
+  char **restrict sentinal)
+{
+  return(InterpretLocaleValue(string,sentinal));
+}
+
+static double StringToDoubleInterval(const char *string,const double interval)
 {
   char
     *q;
 
   double
-    scale,
     value;
 
   value=InterpretLocaleValue(string,&q);
-  scale=1000.0;
-  if ((*q != '\0') && (tolower((int) ((unsigned char) *(q+1))) == 'i'))
-    scale=1024.0;
-  switch (tolower((int) ((unsigned char) *q)))
-  {
-    case '%': value*=pow(scale,0)*interval/100.0; break;
-    case 'k': value*=pow(scale,1); break;
-    case 'm': value*=pow(scale,2); break;
-    case 'g': value*=pow(scale,3); break;
-    case 't': value*=pow(scale,4); break;
-    case 'p': value*=pow(scale,5); break;
-    case 'e': value*=pow(scale,6); break;
-    case 'z': value*=pow(scale,7); break;
-    case 'y': value*=pow(scale,8); break;
-    default:  break;
-  }
+  if (*q == '%')
+    value*=interval/100.0;
   return(value);
 }
 
@@ -1069,7 +1081,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
   MagickStatusType
     flags;
 
-  PixelPacket
+  PixelInfo
     *color,
     target_color;
 
@@ -1130,7 +1142,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
 
           limit=MagickResourceInfinity;
           if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
-            limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+            limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+              100.0);
           (void) SetMagickResourceLimit(AreaResource,limit);
           break;
         }
@@ -1143,13 +1156,13 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (LocaleCompare(attribute,"authenticate") == 0)
         {
           if (info)
-            (void) CloneString(&info->image_info->authenticate,SvPV(sval,na));
+            SetImageOption(info->image_info,attribute,SvPV(sval,na));
           break;
         }
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'B':
@@ -1157,7 +1170,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
     {
       if (LocaleCompare(attribute,"background") == 0)
         {
-          (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+          (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+            exception);
           if (info)
             info->image_info->background_color=target_color;
           for ( ; image; image=image->next)
@@ -1167,7 +1181,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (LocaleCompare(attribute,"bias") == 0)
         {
           for ( ; image; image=image->next)
-            image->bias=SiPrefixToDouble(SvPV(sval,na),QuantumRange);
+            image->bias=StringToDoubleInterval(SvPV(sval,na),(double)
+              QuantumRange+1.0);
           break;
         }
       if (LocaleCompare(attribute,"blue-primary") == 0)
@@ -1185,7 +1200,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
         }
       if (LocaleCompare(attribute,"bordercolor") == 0)
         {
-          (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+          (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+            exception);
           if (info)
             info->image_info->border_color=target_color;
           for ( ; image; image=image->next)
@@ -1195,7 +1211,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'C':
@@ -1204,9 +1220,9 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (LocaleCompare(attribute,"cache-threshold") == 0)
         {
           (void) SetMagickResourceLimit(MemoryResource,(MagickSizeType)
-            SiPrefixToDouble(SvPV(sval,na),100.0));
+            SiPrefixToDoubleInterval(SvPV(sval,na),100.0));
           (void) SetMagickResourceLimit(MapResource,(MagickSizeType)
-            (2*SiPrefixToDouble(SvPV(sval,na),100.0)));
+            (2.0*SiPrefixToDoubleInterval(SvPV(sval,na),100.0)));
           break;
         }
       if (LocaleCompare(attribute,"clip-mask") == 0)
@@ -1240,7 +1256,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
               i%=image->colors;
             if ((strchr(SvPV(sval,na),',') == 0) ||
                 (strchr(SvPV(sval,na),')') != 0))
-              QueryColorDatabase(SvPV(sval,na),image->colormap+i,exception);
+              QueryColorCompliance(SvPV(sval,na),AllCompliance,
+                image->colormap+i,exception);
             else
               {
                 color=image->colormap+i;
@@ -1269,7 +1286,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
               break;
             }
           for ( ; image; image=image->next)
-            (void) TransformImageColorspace(image,(ColorspaceType) sp);
+            (void) TransformImageColorspace(image,(ColorspaceType) sp,
+              exception);
           break;
         }
       if (LocaleCompare(attribute,"comment") == 0)
@@ -1277,7 +1295,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
           for ( ; image; image=image->next)
             (void) SetImageProperty(image,"Comment",InterpretImageProperties(
               info ? info->image_info : (ImageInfo *) NULL,image,
-              SvPV(sval,na),exception));
+              SvPV(sval,na),exception),exception);
           break;
         }
       if (LocaleCompare(attribute,"compression") == 0)
@@ -1299,7 +1317,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'D':
@@ -1329,7 +1347,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
 
           limit=MagickResourceInfinity;
           if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
-            limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+            limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+              100.0);
           (void) SetMagickResourceLimit(DiskResource,limit);
           break;
         }
@@ -1346,10 +1365,10 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
           for ( ; image; image=image->next)
           {
             flags=ParseGeometry(SvPV(sval,na),&geometry_info);
-            image->x_resolution=geometry_info.rho;
-            image->y_resolution=geometry_info.sigma;
+            image->resolution.x=geometry_info.rho;
+            image->resolution.y=geometry_info.sigma;
             if ((flags & SigmaValue) == 0)
-              image->y_resolution=image->x_resolution;
+              image->resolution.y=image->resolution.x;
           }
           break;
         }
@@ -1358,7 +1377,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
           if (info)
             info->image_info->depth=SvIV(sval);
           for ( ; image; image=image->next)
-            (void) SetImageDepth(image,SvIV(sval));
+            (void) SetImageDepth(image,SvIV(sval),exception);
           break;
         }
       if (LocaleCompare(attribute,"dispose") == 0)
@@ -1401,7 +1420,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'E':
@@ -1434,7 +1453,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'F':
@@ -1494,15 +1513,17 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (LocaleCompare(attribute,"fuzz") == 0)
         {
           if (info)
-            info->image_info->fuzz=SiPrefixToDouble(SvPV(sval,na),QuantumRange);
+            info->image_info->fuzz=StringToDoubleInterval(SvPV(sval,na),(double)
+              QuantumRange+1.0);
           for ( ; image; image=image->next)
-            image->fuzz=SiPrefixToDouble(SvPV(sval,na),QuantumRange);
+            image->fuzz=StringToDoubleInterval(SvPV(sval,na),(double)
+              QuantumRange+1.0);
           break;
         }
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'G':
@@ -1546,7 +1567,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'I':
@@ -1613,7 +1634,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'L':
@@ -1624,7 +1645,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
           for ( ; image; image=image->next)
             (void) SetImageProperty(image,"label",InterpretImageProperties(
               info ? info->image_info : (ImageInfo *) NULL,image,
-              SvPV(sval,na),exception));
+              SvPV(sval,na),exception),exception);
           break;
         }
       if (LocaleCompare(attribute,"loop") == 0)
@@ -1632,7 +1653,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'M':
@@ -1654,7 +1675,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
 
           limit=MagickResourceInfinity;
           if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
-            limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+            limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+              100.0);
           (void) SetMagickResourceLimit(MapResource,limit);
           break;
         }
@@ -1672,7 +1694,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
         }
       if (LocaleCompare(attribute,"mattecolor") == 0)
         {
-          (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+          (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+            exception);
           if (info)
             info->image_info->matte_color=target_color;
           for ( ; image; image=image->next)
@@ -1700,7 +1723,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
 
           limit=MagickResourceInfinity;
           if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
-            limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+            limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+              100.0);
           (void) SetMagickResourceLimit(MemoryResource,limit);
           break;
         }
@@ -1723,7 +1747,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'O':
@@ -1754,7 +1778,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'P':
@@ -1807,7 +1831,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
               {
                 if ((strchr(SvPV(sval,na),',') == 0) ||
                     (strchr(SvPV(sval,na),')') != 0))
-                  QueryMagickColor(SvPV(sval,na),&pixel,exception);
+                  QueryColorCompliance(SvPV(sval,na),AllCompliance,
+                    &pixel,exception);
                 else
                   {
                     GetPixelInfo(image,&pixel);
@@ -1860,7 +1885,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'Q':
@@ -1877,7 +1902,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'R':
@@ -1953,7 +1978,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'S':
@@ -2003,7 +2028,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'T':
@@ -2022,7 +2047,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
 
           limit=MagickResourceInfinity;
           if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
-            limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+            limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+              100.0);
           (void) SetMagickResourceLimit(ThreadResource,limit);
           break;
         }
@@ -2047,13 +2073,15 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
 
           limit=MagickResourceInfinity;
           if (LocaleCompare(SvPV(sval,na),"unlimited") != 0)
-            limit=(MagickSizeType) SiPrefixToDouble(SvPV(sval,na),100.0);
+            limit=(MagickSizeType) SiPrefixToDoubleInterval(SvPV(sval,na),
+              100.0);
           (void) SetMagickResourceLimit(TimeResource,limit);
           break;
         }
       if (LocaleCompare(attribute,"transparent-color") == 0)
         {
-          (void) QueryColorDatabase(SvPV(sval,na),&target_color,exception);
+          (void) QueryColorCompliance(SvPV(sval,na),AllCompliance,&target_color,
+            exception);
           if (info)
             info->image_info->transparent_color=target_color;
           for ( ; image; image=image->next)
@@ -2079,7 +2107,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'U':
@@ -2111,8 +2139,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
                 {
                   if (units == PixelsPerCentimeterResolution)
                     {
-                      image->x_resolution*=2.54;
-                      image->y_resolution*=2.54;
+                      image->resolution.x*=2.54;
+                      image->resolution.y*=2.54;
                     }
                   break;
                 }
@@ -2120,8 +2148,8 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
                 {
                   if (units == PixelsPerInchResolution)
                     {
-                      image->x_resolution/=2.54;
-                      image->y_resolution/=2.54;
+                      image->resolution.x/=2.54;
+                      image->resolution.y/=2.54;
                     }
                   break;
                 }
@@ -2133,7 +2161,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'V':
@@ -2178,7 +2206,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     case 'W':
@@ -2200,7 +2228,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
     default:
@@ -2208,7 +2236,7 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (info)
         SetImageOption(info->image_info,attribute,SvPV(sval,na));
       for ( ; image; image=image->next)
-        SetImageProperty(image,attribute,SvPV(sval,na));
+        SetImageProperty(image,attribute,SvPV(sval,na),exception);
       break;
     }
   }
@@ -3154,7 +3182,7 @@ Compare(ref,...)
                     "UnrecognizedType",SvPV(ST(i),na));
                   return;
                 }
-              SetPixelChannelMap(image,(ChannelType) option);
+              SetPixelChannelMapMask(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -3166,7 +3194,7 @@ Compare(ref,...)
         {
           if (LocaleCompare(attribute,"fuzz") == 0)
             {
-              image->fuzz=SiPrefixToDouble(SvPV(ST(i),na),100.0);
+              image->fuzz=StringToDoubleInterval(SvPV(ST(i),na),100.0);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -3845,8 +3873,7 @@ Features(ref,...)
     count=0;
     for ( ; image; image=image->next)
     {
-      channel_features=GetImageFeatures(image,distance,
-        &image->exception);
+      channel_features=GetImageFeatures(image,distance,exception);
       if (channel_features == (ChannelFeatures *) NULL)
         continue;
       count++;
@@ -3908,7 +3935,7 @@ Flatten(ref)
     Image
       *image;
 
-    PixelPacket
+    PixelInfo
       background_color;
 
     register ssize_t
@@ -3945,8 +3972,8 @@ Flatten(ref)
       }
     background_color=image->background_color;
     if (items == 2)
-      (void) QueryColorDatabase((char *) SvPV(ST(1),na),&background_color,
-        exception);
+      (void) QueryColorCompliance((char *) SvPV(ST(1),na),AllCompliance,
+        &background_color,exception);
     else
       for (i=2; i < items; i+=2)
       {
@@ -3958,8 +3985,8 @@ Flatten(ref)
           {
             if (LocaleCompare(attribute,"background") == 0)
               {
-                (void) QueryColorDatabase((char *) SvPV(ST(1),na),
-                  &background_color,exception);
+                (void) QueryColorCompliance((char *) SvPV(ST(1),na),
+                  AllCompliance,&background_color,exception);
                 break;
               }
             ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -4270,7 +4297,7 @@ Get(ref,...)
               const char
                 *value;
 
-              value=GetImageProperty(image,attribute);
+              value=GetImageProperty(image,attribute,exception);
               if (value != (const char *) NULL)
                 s=newSVpv(value,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -4279,7 +4306,14 @@ Get(ref,...)
           if (LocaleCompare(attribute,"authenticate") == 0)
             {
               if (info)
-                s=newSVpv(info->image_info->authenticate,0);
+                {
+                  const char
+                    *option;
+
+                  option=GetImageOption(info->image_info,attribute);
+                  if (option != (const char *) NULL)
+                    s=newSVpv(option,0);
+                }
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
             }
@@ -4294,10 +4328,10 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
-                QuantumFormat "," QuantumFormat "," QuantumFormat,
-                image->background_color.red,image->background_color.green,
-                image->background_color.blue,image->background_color.alpha);
+              (void) FormatLocaleString(color,MaxTextExtent,
+                "%.20g,%.20g,%.20g,%.20g",image->background_color.red,
+                image->background_color.green,image->background_color.blue,
+                image->background_color.alpha);
               s=newSVpv(color,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -4359,10 +4393,10 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
-                QuantumFormat "," QuantumFormat "," QuantumFormat,
-                image->border_color.red,image->border_color.green,
-                image->border_color.blue,image->border_color.alpha);
+              (void) FormatLocaleString(color,MaxTextExtent,
+                "%.20g,%.20g,%.20g,%.20g",image->border_color.red,
+                image->border_color.green,image->border_color.blue,
+                image->border_color.alpha);
               s=newSVpv(color,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -4377,7 +4411,7 @@ Get(ref,...)
 
               if (image == (Image *) NULL)
                 break;
-              page=GetImageBoundingBox(image,&image->exception);
+              page=GetImageBoundingBox(image,exception);
               (void) FormatLocaleString(geometry,MaxTextExtent,
                 "%.20gx%.20g%+.20g%+.20g",(double) page.width,(double)
                 page.height,(double) page.x,(double) page.y);
@@ -4469,7 +4503,7 @@ Get(ref,...)
             {
               if (image != (Image *) NULL)
                 s=newSViv((ssize_t) GetNumberColors(image,(FILE *) NULL,
-                  &image->exception));
+                  exception));
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
             }
@@ -4485,10 +4519,10 @@ Get(ref,...)
               (void) items;
               if (j > (ssize_t) image->colors)
                 j%=image->colors;
-              (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
-                QuantumFormat "," QuantumFormat "," QuantumFormat,
-                image->colormap[j].red,image->colormap[j].green,
-                image->colormap[j].blue,image->colormap[j].alpha);
+              (void) FormatLocaleString(color,MaxTextExtent,
+                "%.20g,%.20g,%.20g,%.20g",image->colormap[j].red,
+                image->colormap[j].green,image->colormap[j].blue,
+                image->colormap[j].alpha);
               s=newSVpv(color,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -4505,7 +4539,7 @@ Get(ref,...)
               const char
                 *value;
 
-              value=GetImageProperty(image,attribute);
+              value=GetImageProperty(image,attribute,exception);
               if (value != (const char *) NULL)
                 s=newSVpv(value,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -4532,7 +4566,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) FormatLocaleString(geometry,MaxTextExtent,"%.15gx%.15g",
-                image->x_resolution,image->y_resolution);
+                image->resolution.x,image->resolution.y);
               s=newSVpv(geometry,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -4548,7 +4582,7 @@ Get(ref,...)
             {
               s=newSViv(MAGICKCORE_QUANTUM_DEPTH);
               if (image != (Image *) NULL)
-                s=newSViv((ssize_t) GetImageDepth(image,&image->exception));
+                s=newSViv((ssize_t) GetImageDepth(image,exception));
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
             }
@@ -4673,7 +4707,7 @@ Get(ref,...)
               if (info && (*info->image_info->magick != '\0'))
                 magick_info=GetMagickInfo(info->image_info->magick,exception);
               if (image != (Image *) NULL)
-                magick_info=GetMagickInfo(image->magick,&image->exception);
+                magick_info=GetMagickInfo(image->magick,exception);
               if ((magick_info != (const MagickInfo *) NULL) &&
                   (*magick_info->description != '\0'))
                 s=newSVpv((char *) magick_info->description,0);
@@ -4797,7 +4831,7 @@ Get(ref,...)
                   (void) FormatLocaleString(key,MaxTextExtent,"%.20g\n",(double)
                     id);
                   status=SetImageRegistry(ImageRegistryType,key,image,
-                    &image->exception);
+                    exception);
                   (void) status;
                   s=newSViv(id++);
                 }
@@ -4831,7 +4865,7 @@ Get(ref,...)
               items=sscanf(attribute,"%*[^[][%ld%*[,/]%ld",&x,&y);
               (void) items;
               image_view=AcquireCacheView(image);
-              p=GetCacheViewVirtualPixels(image_view,x,y,1,1,&image->exception);
+              p=GetCacheViewVirtualPixels(image_view,x,y,1,1,exception);
               if (p != (const Quantum *) NULL)
                 {
                   (void) FormatLocaleString(name,MaxTextExtent,QuantumFormat,
@@ -4889,7 +4923,7 @@ Get(ref,...)
 
               if (image == (Image *) NULL)
                 break;
-              value=GetImageProperty(image,"Label");
+              value=GetImageProperty(image,"Label",exception);
               if (value != (const char *) NULL)
                 s=newSVpv(value,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -4957,10 +4991,10 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
-                QuantumFormat "," QuantumFormat "," QuantumFormat,
-                image->matte_color.red,image->matte_color.green,
-                image->matte_color.blue,image->matte_color.alpha);
+              (void) FormatLocaleString(color,MaxTextExtent,
+                "%.20g,%.20g,%.20g,%.20g",image->matte_color.red,
+                image->matte_color.green,image->matte_color.blue,
+                image->matte_color.alpha);
               s=newSVpv(color,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -4999,7 +5033,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 continue;
               j=info ? info->image_info->monochrome :
-                IsImageMonochrome(image,&image->exception);
+                IsImageMonochrome(image,exception);
               s=newSViv(j);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -5228,7 +5262,7 @@ Get(ref,...)
               if (image == (Image *) NULL)
                 break;
               (void) SignatureImage(image,exception);
-              value=GetImageProperty(image,"Signature");
+              value=GetImageProperty(image,"Signature",exception);
               if (value != (const char *) NULL)
                 s=newSVpv(value,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
@@ -5259,7 +5293,7 @@ Get(ref,...)
             {
               s=newSViv(MAGICKCORE_QUANTUM_DEPTH);
               if (image != (Image *) NULL)
-                s=newSVnv(GetImageTotalInkDensity(image));
+                s=newSVnv(GetImageTotalInkDensity(image,exception));
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
             }
@@ -5267,10 +5301,10 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              (void) FormatLocaleString(color,MaxTextExtent,QuantumFormat ","
-                QuantumFormat "," QuantumFormat "," QuantumFormat,
-                image->transparent_color.red,image->transparent_color.green,
-                image->transparent_color.blue,image->transparent_color.alpha);
+              (void) FormatLocaleString(color,MaxTextExtent,
+                "%.20g,%.20g,%.20g,%.20g",image->transparent_color.red,
+                image->transparent_color.green,image->transparent_color.blue,
+                image->transparent_color.alpha);
               s=newSVpv(color,0);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
@@ -5279,7 +5313,7 @@ Get(ref,...)
             {
               if (image == (Image *) NULL)
                 break;
-              j=(ssize_t) GetImageType(image,&image->exception);
+              j=(ssize_t) GetImageType(image,exception);
               s=newSViv(j);
               (void) sv_setpv(s,CommandOptionToMnemonic(MagickTypeOptions,j));
               SvIOK_on(s);
@@ -5391,7 +5425,7 @@ Get(ref,...)
           if (LocaleCompare(attribute,"x-resolution") == 0)
             {
               if (image != (Image *) NULL)
-                s=newSVnv(image->x_resolution);
+                s=newSVnv(image->resolution.x);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
             }
@@ -5405,7 +5439,7 @@ Get(ref,...)
           if (LocaleCompare(attribute,"y-resolution") == 0)
             {
               if (image != (Image *) NULL)
-                s=newSVnv(image->y_resolution);
+                s=newSVnv(image->resolution.y);
               PUSHs(s ? sv_2mortal(s) : &sv_undef);
               continue;
             }
@@ -5421,7 +5455,7 @@ Get(ref,...)
           attribute)
       else
         {
-          value=GetImageProperty(image,attribute);
+          value=GetImageProperty(image,attribute,exception);
           if (value != (const char *) NULL)
             {
               s=newSVpv(value,0);
@@ -5927,7 +5961,7 @@ Histogram(ref,...)
     char
       message[MaxTextExtent];
 
-    PixelPacket
+    PixelInfo
       *histogram;
 
     ExceptionInfo
@@ -5977,36 +6011,36 @@ Histogram(ref,...)
     count=0;
     for ( ; image; image=image->next)
     {
-      histogram=GetImageHistogram(image,&number_colors,&image->exception);
-      if (histogram == (PixelPacket *) NULL)
+      histogram=GetImageHistogram(image,&number_colors,exception);
+      if (histogram == (PixelInfo *) NULL)
         continue;
       count+=(ssize_t) number_colors;
       EXTEND(sp,6*count);
       for (i=0; i < (ssize_t) number_colors; i++)
       {
-        (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+        (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
           histogram[i].red);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+        (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
           histogram[i].green);
         PUSHs(sv_2mortal(newSVpv(message,0)));
-        (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+        (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
           histogram[i].blue);
         PUSHs(sv_2mortal(newSVpv(message,0)));
         if (image->colorspace == CMYKColorspace)
           {
-            (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+            (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
               histogram[i].black);
             PUSHs(sv_2mortal(newSVpv(message,0)));
           }
-        (void) FormatLocaleString(message,MaxTextExtent,QuantumFormat,
+        (void) FormatLocaleString(message,MaxTextExtent,"%.20g",
           histogram[i].alpha);
         PUSHs(sv_2mortal(newSVpv(message,0)));
         (void) FormatLocaleString(message,MaxTextExtent,"%.20g",(double)
           histogram[i].count);
         PUSHs(sv_2mortal(newSVpv(message,0)));
       }
-      histogram=(PixelPacket *) RelinquishMagickMemory(histogram);
+      histogram=(PixelInfo *) RelinquishMagickMemory(histogram);
     }
 
   PerlException:
@@ -6111,7 +6145,7 @@ GetPixel(ref,...)
                     SvPV(ST(i),na));
                   return;
                 }
-              SetPixelChannelMap(image,(ChannelType) option);
+              SetPixelChannelMapMask(image,(ChannelType) option);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -6543,7 +6577,7 @@ ImageToBlob(ref,...)
       next->scene=scene++;
     }
     SetImageInfo(package_info->image_info,(unsigned int)
-      GetImageListLength(image),&image->exception);
+      GetImageListLength(image),exception);
     EXTEND(sp,(ssize_t) GetImageListLength(image));
     for ( ; image; image=image->next)
     {
@@ -6742,19 +6776,16 @@ Layers(ref,...)
       case OptimizeTransLayer:
       {
         OptimizeImageTransparency(image,exception);
-        InheritException(&(image->exception),exception);
         break;
       }
       case RemoveDupsLayer:
       {
         RemoveDuplicateLayers(&image,exception);
-        InheritException(&(image->exception),exception);
         break;
       }
       case RemoveZeroLayer:
       {
         RemoveZeroDelayLayers(&image,exception);
-        InheritException(&(image->exception),exception);
         break;
       }
       case OptimizeLayer:
@@ -6768,17 +6799,14 @@ Layers(ref,...)
         layers=CoalesceImages(image,exception);
         if (layers == (Image *) NULL)
           break;
-        InheritException(&(layers->exception),exception);
         image=layers;
         layers=OptimizeImageLayers(image,exception);
         if (layers == (Image *) NULL)
           break;
-        InheritException(&(layers->exception),exception);
         image=DestroyImageList(image);
         image=layers;
         layers=(Image *) NULL;
         OptimizeImageTransparency(image,exception);
-        InheritException(&(image->exception),exception);
         quantize_info=AcquireQuantizeInfo(info->image_info);
         (void) RemapImages(quantize_info,image,(Image *) NULL,exception);
         quantize_info=DestroyQuantizeInfo(quantize_info);
@@ -6837,15 +6865,11 @@ Layers(ref,...)
           image->rows,image->gravity,&geometry);
         CompositeLayers(image,compose,source,geometry.x,geometry.y,exception);
         source=DestroyImageList(source);
-        InheritException(&(image->exception),exception);
         break;
       }
     }
     if (layers != (Image *) NULL)
-      {
-        InheritException(&(layers->exception),exception);
-        image=layers;
-      }
+      image=layers;
     if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
       goto PerlException;
     for ( ; image; image=image->next)
@@ -7129,8 +7153,8 @@ Mogrify(ref,...)
     ClipMaskImage      = 212
     LinearStretch      = 213
     LinearStretchImage = 214
-    RecolorImage       = 215
-    Recolor            = 216
+    ColorMatrix        = 215
+    ColorMatrixImage   = 216
     Mask               = 217
     MaskImage          = 218
     Polaroid           = 219
@@ -7175,18 +7199,16 @@ Mogrify(ref,...)
     LevelImageColors   = 258
     Clamp              = 259
     ClampImage         = 260
-    BrightnessContrast = 263
-    BrightnessContrastImage = 264
-    Morphology         = 265
-    MorphologyImage    = 266
-    ColorMatrix        = 267
-    ColorMatrixImage   = 268
-    Color              = 269
-    ColorImage         = 270
-    Mode               = 271
-    ModeImage          = 272
-    Statistic          = 273
-    StatisticImage     = 274
+    BrightnessContrast = 261
+    BrightnessContrastImage = 262
+    Morphology         = 263
+    MorphologyImage    = 264
+    Color              = 265
+    ColorImage         = 266
+    Mode               = 267
+    ModeImage          = 268
+    Statistic          = 269
+    StatisticImage     = 270
     MogrifyRegion      = 666
   PPCODE:
   {
@@ -7229,7 +7251,7 @@ Mogrify(ref,...)
     MagickStatusType
       flags;
 
-    PixelPacket
+    PixelInfo
       fill_color;
 
     RectangleInfo
@@ -7469,7 +7491,7 @@ Mogrify(ref,...)
             argument_list[0].string_reference=(char *) NULL;
           (void) SetImageProperty(image,"comment",InterpretImageProperties(
             info ? info->image_info : (ImageInfo *) NULL,image,
-            argument_list[0].string_reference,exception));
+            argument_list[0].string_reference,exception),exception);
           break;
         }
         case 2:  /* Label */
@@ -7478,39 +7500,56 @@ Mogrify(ref,...)
             argument_list[0].string_reference=(char *) NULL;
           (void) SetImageProperty(image,"label",InterpretImageProperties(
             info ? info->image_info : (ImageInfo *) NULL,image,
-            argument_list[0].string_reference,exception));
+            argument_list[0].string_reference,exception),exception);
           break;
         }
         case 3:  /* AddNoise */
         {
+          double
+            attenuate;
+
           if (attribute_flag[0] == 0)
             argument_list[0].integer_reference=UniformNoise;
+          attenuate=1.0;
           if (attribute_flag[1] != 0)
-            channel=(ChannelType) argument_list[1].integer_reference;
+            attenuate=argument_list[1].real_reference;
+          if (attribute_flag[2] != 0)
+            channel=(ChannelType) argument_list[2].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=AddNoiseImage(image,(NoiseType)
-            argument_list[0].integer_reference,exception);
+            argument_list[0].integer_reference,attenuate,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
         case 4:  /* Colorize */
         {
-          PixelPacket
+          PixelInfo
             target;
 
-          (void) GetOneVirtualPixel(image,0,0,&target,exception);
+          Quantum
+            virtual_pixel[MaxPixelChannels];
+
+          GetPixelInfo(image,&target);
+          (void) GetOneVirtualPixel(image,0,0,virtual_pixel,exception);
+          target.red=virtual_pixel[RedPixelChannel];
+          target.green=virtual_pixel[GreenPixelChannel];
+          target.blue=virtual_pixel[BluePixelChannel];
+          target.alpha=virtual_pixel[AlphaPixelChannel];
           if (attribute_flag[0] != 0)
-            (void) QueryColorDatabase(argument_list[0].string_reference,&target,
-              exception);
+            (void) QueryColorCompliance(argument_list[0].string_reference,
+              AllCompliance,&target,exception);
           if (attribute_flag[1] == 0)
             argument_list[1].string_reference="100%";
-          image=ColorizeImage(image,argument_list[1].string_reference,target,
+          image=ColorizeImage(image,argument_list[1].string_reference,&target,
             exception);
           break;
         }
         case 5:  /* Border */
         {
+          CompositeOperator
+            compose;
+
           geometry.width=0;
           geometry.height=0;
           if (attribute_flag[0] != 0)
@@ -7525,17 +7564,18 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry.height=argument_list[2].integer_reference;
           if (attribute_flag[3] != 0)
-            QueryColorDatabase(argument_list[3].string_reference,
-              &image->border_color,exception);
+            QueryColorCompliance(argument_list[3].string_reference,
+              AllCompliance,&image->border_color,exception);
           if (attribute_flag[4] != 0)
-            QueryColorDatabase(argument_list[4].string_reference,
-              &image->border_color,exception);
+            QueryColorCompliance(argument_list[4].string_reference,
+              AllCompliance,&image->border_color,exception);
           if (attribute_flag[5] != 0)
-            QueryColorDatabase(argument_list[5].string_reference,
-              &image->border_color,exception);
+            QueryColorCompliance(argument_list[5].string_reference,
+              AllCompliance,&image->border_color,exception);
+          compose=image->compose;
           if (attribute_flag[6] != 0)
-            image->compose=(CompositeOperator) argument_list[6].integer_reference;
-          image=BorderImage(image,&geometry,exception);
+            compose=(CompositeOperator) argument_list[6].integer_reference;
+          image=BorderImage(image,&geometry,compose,exception);
           break;
         }
         case 6:  /* Blur */
@@ -7552,10 +7592,12 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
-            channel=(ChannelType) argument_list[3].integer_reference;
+            geometry_info.xi=argument_list[3].real_reference;
+          if (attribute_flag[4] != 0)
+            channel=(ChannelType) argument_list[4].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=BlurImage(image,geometry_info.rho,geometry_info.sigma,
-            exception);
+            geometry_info.xi,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -7592,8 +7634,8 @@ Mogrify(ref,...)
           if (attribute_flag[4] != 0)
             geometry.y=argument_list[4].integer_reference;
           if (attribute_flag[5] != 0)
-            image->fuzz=
-              SiPrefixToDouble(argument_list[5].string_reference,QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[5].string_reference,(double) QuantumRange+1.0);
           image=CropImage(image,&geometry,exception);
           break;
         }
@@ -7644,6 +7686,9 @@ Mogrify(ref,...)
         }
         case 15:  /* Frame */
         {
+          CompositeOperator
+            compose;
+
           FrameInfo
             frame_info;
 
@@ -7667,31 +7712,35 @@ Mogrify(ref,...)
           if (attribute_flag[4] != 0)
             frame_info.outer_bevel=argument_list[4].integer_reference;
           if (attribute_flag[5] != 0)
-            QueryColorDatabase(argument_list[5].string_reference,&fill_color,
-              exception);
+            QueryColorCompliance(argument_list[5].string_reference,
+              AllCompliance,&fill_color,exception);
           if (attribute_flag[6] != 0)
-            QueryColorDatabase(argument_list[6].string_reference,&fill_color,
-              exception);
+            QueryColorCompliance(argument_list[6].string_reference,
+              AllCompliance,&fill_color,exception);
           frame_info.x=(ssize_t) frame_info.width;
           frame_info.y=(ssize_t) frame_info.height;
           frame_info.width=image->columns+2*frame_info.x;
           frame_info.height=image->rows+2*frame_info.y;
           if ((attribute_flag[5] != 0) || (attribute_flag[6] != 0))
             image->matte_color=fill_color;
+          compose=image->compose;
           if (attribute_flag[7] != 0)
-            image->compose=(CompositeOperator) argument_list[7].integer_reference;
-          image=FrameImage(image,&frame_info,exception);
+            compose=(CompositeOperator) argument_list[7].integer_reference;
+          image=FrameImage(image,&frame_info,compose,exception);
           break;
         }
         case 16:  /* Implode */
         {
+          PixelInterpolateMethod
+            method;
+
           if (attribute_flag[0] == 0)
             argument_list[0].real_reference=0.5;
+          method=UndefinedInterpolatePixel;
           if (attribute_flag[1] != 0)
-            image->interpolate=(InterpolatePixelMethod)
-              argument_list[1].integer_reference;
+            method=(PixelInterpolateMethod) argument_list[1].integer_reference;
           image=ImplodeImage(image,argument_list[0].real_reference,
-            exception);
+            method,exception);
           break;
         }
         case 17:  /* Magnify */
@@ -7706,7 +7755,7 @@ Mogrify(ref,...)
               flags=ParseGeometry(argument_list[0].string_reference,
                 &geometry_info);
               if ((flags & SigmaValue) == 0)
-                geometry_info.sigma=1.0;
+                geometry_info.sigma=geometry_info.rho;
             }
           if (attribute_flag[1] != 0)
             geometry_info.rho=argument_list[1].real_reference;
@@ -7775,14 +7824,14 @@ Mogrify(ref,...)
           if (attribute_flag[0] == 0)
             argument_list[0].real_reference=90.0;
           if (attribute_flag[1] != 0)
-            QueryColorDatabase(argument_list[1].string_reference,
-              &image->background_color,exception);
+            QueryColorCompliance(argument_list[1].string_reference,
+              AllCompliance,&image->background_color,exception);
           if (attribute_flag[2] != 0)
-            QueryColorDatabase(argument_list[2].string_reference,
-              &image->background_color,exception);
+            QueryColorCompliance(argument_list[2].string_reference,
+              AllCompliance,&image->background_color,exception);
           if (attribute_flag[3] != 0)
-            QueryColorDatabase(argument_list[3].string_reference,
-              &image->background_color,exception);
+            QueryColorCompliance(argument_list[3].string_reference,
+              AllCompliance,&image->background_color,exception);
           image=RotateImage(image,argument_list[0].real_reference,exception);
           break;
         }
@@ -7842,10 +7891,12 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
-            channel=(ChannelType) argument_list[3].integer_reference;
+            geometry_info.xi=argument_list[3].real_reference;
+          if (attribute_flag[4] != 0)
+            channel=(ChannelType) argument_list[4].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=SharpenImage(image,geometry_info.rho,geometry_info.sigma,
-            exception);
+            geometry_info.xi,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -7864,30 +7915,41 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
-            QueryColorDatabase(argument_list[3].string_reference,
-              &image->background_color,exception);
+            QueryColorCompliance(argument_list[3].string_reference,
+              AllCompliance,&image->background_color,exception);
           if (attribute_flag[4] != 0)
-            QueryColorDatabase(argument_list[4].string_reference,
-              &image->background_color,exception);
+            QueryColorCompliance(argument_list[4].string_reference,
+              AllCompliance,&image->background_color,exception);
           image=ShearImage(image,geometry_info.rho,geometry_info.sigma,
             exception);
           break;
         }
         case 29:  /* Spread */
         {
+          PixelInterpolateMethod
+            method;
+
           if (attribute_flag[0] == 0)
             argument_list[0].real_reference=1.0;
-          image=SpreadImage(image,argument_list[0].real_reference,exception);
+          method=UndefinedInterpolatePixel;
+          if (attribute_flag[1] != 0)
+            method=(PixelInterpolateMethod) argument_list[1].integer_reference;
+          image=SpreadImage(image,argument_list[0].real_reference,method,
+            exception);
           break;
         }
         case 30:  /* Swirl */
         {
+          PixelInterpolateMethod
+            method;
+
           if (attribute_flag[0] == 0)
             argument_list[0].real_reference=50.0;
+          method=UndefinedInterpolatePixel;
           if (attribute_flag[1] != 0)
-            image->interpolate=(InterpolatePixelMethod)
-              argument_list[1].integer_reference;
-          image=SwirlImage(image,argument_list[0].real_reference,exception);
+            method=(PixelInterpolateMethod) argument_list[1].integer_reference;
+          image=SwirlImage(image,argument_list[0].real_reference,
+            method,exception);
           break;
         }
         case 31:  /* Resize */
@@ -7939,20 +8001,20 @@ Mogrify(ref,...)
             (void) CloneString(&draw_info->density,
               argument_list[3].string_reference);
           if (attribute_flag[4] != 0)
-            (void) QueryColorDatabase(argument_list[4].string_reference,
-              &draw_info->undercolor,exception);
+            (void) QueryColorCompliance(argument_list[4].string_reference,
+              AllCompliance,&draw_info->undercolor,exception);
           if (attribute_flag[5] != 0)
             {
-              (void) QueryColorDatabase(argument_list[5].string_reference,
-                &draw_info->stroke,exception);
+              (void) QueryColorCompliance(argument_list[5].string_reference,
+                AllCompliance,&draw_info->stroke,exception);
               if (argument_list[5].image_reference != (Image *) NULL)
                 draw_info->stroke_pattern=CloneImage(
                   argument_list[5].image_reference,0,0,MagickTrue,exception);
             }
           if (attribute_flag[6] != 0)
             {
-              (void) QueryColorDatabase(argument_list[6].string_reference,
-                &draw_info->fill,exception);
+              (void) QueryColorCompliance(argument_list[6].string_reference,
+                AllCompliance,&draw_info->fill,exception);
               if (argument_list[6].image_reference != (Image *) NULL)
                 draw_info->fill_pattern=CloneImage(
                   argument_list[6].image_reference,0,0,MagickTrue,exception);
@@ -7967,10 +8029,11 @@ Mogrify(ref,...)
                 geometry_info.sigma=geometry_info.xi;
             }
           if (attribute_flag[8] != 0)
-            (void) QueryColorDatabase(argument_list[8].string_reference,
-              &draw_info->fill,exception);
+            (void) QueryColorCompliance(argument_list[8].string_reference,
+              AllCompliance,&draw_info->fill,exception);
           if (attribute_flag[11] != 0)
-            draw_info->gravity=(GravityType) argument_list[11].integer_reference;
+            draw_info->gravity=(GravityType)
+              argument_list[11].integer_reference;
           if (attribute_flag[25] != 0)
             {
               AV
@@ -8142,6 +8205,9 @@ Mogrify(ref,...)
           PixelInfo
             target;
 
+          Quantum
+            virtual_pixel[MaxPixelChannels];
+
           draw_info=CloneDrawInfo(info ? info->image_info :
             (ImageInfo *) NULL,(DrawInfo *) NULL);
           if (attribute_flag[0] != 0)
@@ -8152,20 +8218,24 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry.y=argument_list[2].integer_reference;
           if (attribute_flag[3] != 0)
-            (void) QueryColorDatabase(argument_list[3].string_reference,
-              &draw_info->fill,exception);
-          (void) GetOneVirtualMagickPixel(image,geometry.x,geometry.y,&target,
+            (void) QueryColorCompliance(argument_list[3].string_reference,
+              AllCompliance,&draw_info->fill,exception);
+          (void) GetOneVirtualPixel(image,geometry.x,geometry.y,virtual_pixel,
             exception);
+          target.red=virtual_pixel[RedPixelChannel];
+          target.green=virtual_pixel[GreenPixelChannel];
+          target.blue=virtual_pixel[BluePixelChannel];
+          target.alpha=virtual_pixel[AlphaPixelChannel];
           invert=MagickFalse;
           if (attribute_flag[4] != 0)
             {
-              QueryMagickColor(argument_list[4].string_reference,&target,
-                exception);
+              QueryColorCompliance(argument_list[4].string_reference,
+                AllCompliance,&target,exception);
               invert=MagickTrue;
             }
           if (attribute_flag[5] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[5].string_reference,(double) QuantumRange+1.0);
           if (attribute_flag[6] != 0)
             invert=(MagickBooleanType) argument_list[6].integer_reference;
           (void) FloodfillPaintImage(image,draw_info,&target,geometry.x,
@@ -8199,9 +8269,9 @@ Mogrify(ref,...)
           if (attribute_flag[6] != 0) /* opacity  */
             {
               if (compose != DissolveCompositeOp)
-                (void) SetImageOpacity(composite_image,(Quantum)
-                  SiPrefixToDouble(argument_list[6].string_reference,
-                  QuantumRange));
+                (void) SetImageAlpha(composite_image,(Quantum)
+                  StringToDoubleInterval(argument_list[6].string_reference,
+                  (double) QuantumRange+1.0),exception);
               else
                 {
                   CacheView
@@ -8228,10 +8298,11 @@ Mogrify(ref,...)
                   */
                   (void) CloneString(&image->geometry,
                     argument_list[6].string_reference);
-                  opacity=(Quantum) SiPrefixToDouble(
-                    argument_list[6].string_reference,QuantumRange);
+                  opacity=(Quantum) StringToDoubleInterval(
+                    argument_list[6].string_reference,(double) QuantumRange+
+                    1.0);
                   if (composite_image->matte != MagickTrue)
-                    (void) SetImageOpacity(composite_image,OpaqueAlpha);
+                    (void) SetImageAlpha(composite_image,OpaqueAlpha,exception);
                   composite_view=AcquireCacheView(composite_image);
                   for (y=0; y < (ssize_t) composite_image->rows ; y++)
                   {
@@ -8240,7 +8311,8 @@ Mogrify(ref,...)
                     for (x=0; x < (ssize_t) composite_image->columns; x++)
                     {
                       if (GetPixelAlpha(image,q) == OpaqueAlpha)
-                        SetPixelAlpha(composite_image,ClampToQuantum(opacity),q);
+                        SetPixelAlpha(composite_image,ClampToQuantum(opacity),
+                          q);
                       q+=GetPixelChannels(composite_image);
                     }
                     sync=SyncCacheViewAuthenticPixels(composite_view,exception);
@@ -8251,10 +8323,10 @@ Mogrify(ref,...)
                 }
             }
           if (attribute_flag[9] != 0)    /* "color=>" */
-            QueryColorDatabase(argument_list[9].string_reference,
-              &composite_image->background_color,exception);
+            QueryColorCompliance(argument_list[9].string_reference,
+              AllCompliance,&composite_image->background_color,exception);
           if (attribute_flag[12] != 0) /* "interpolate=>" */
-            image->interpolate=(InterpolatePixelMethod)
+            image->interpolate=(PixelInterpolateMethod)
               argument_list[12].integer_reference;
           if (attribute_flag[13] != 0)   /* "args=>" */
             (void) SetImageArtifact(composite_image,"compose:args",
@@ -8276,7 +8348,8 @@ Mogrify(ref,...)
                if (rotate_image == (Image *) NULL)
                  break;
             }
-          if (attribute_flag[7] && argument_list[7].integer_reference) /* tile */
+          if ((attribute_flag[7] != 0) &&
+              (argument_list[7].integer_reference != 0)) /* tile */
             {
               ssize_t
                 x,
@@ -8295,9 +8368,11 @@ Mogrify(ref,...)
                 for (x=0; x < (ssize_t) image->columns; x+=(ssize_t) composite_image->columns)
                 {
                   if (attribute_flag[8] != 0) /* rotate */
-                    (void) CompositeImage(image,compose,rotate_image,x,y);
+                    (void) CompositeImage(image,compose,rotate_image,x,y,
+                      exception);
                   else
-                    (void) CompositeImage(image,compose,composite_image,x,y);
+                    (void) CompositeImage(image,compose,composite_image,x,y,
+                      exception);
                 }
               if (attribute_flag[8] != 0) /* rotate */
                 rotate_image=DestroyImage(rotate_image);
@@ -8329,9 +8404,9 @@ Mogrify(ref,...)
                     Merge Y displacement into X displacement image.
                   */
                   composite_image=CloneImage(composite_image,0,0,MagickTrue,
-                    &image->exception);
+                    exception);
                   (void) CompositeImage(composite_image,CopyGreenCompositeOp,
-                    argument_list[10].image_reference,0,0);
+                    argument_list[10].image_reference,0,0,exception);
                 }
               else
                 {
@@ -8339,7 +8414,7 @@ Mogrify(ref,...)
                     Set a blending mask for the composition.
                   */
                   image->mask=CloneImage(argument_list[10].image_reference,0,0,
-                    MagickTrue,&image->exception);
+                    MagickTrue,exception);
                   (void) NegateImage(image->mask,MagickFalse,exception);
                 }
             }
@@ -8356,7 +8431,8 @@ Mogrify(ref,...)
             exception);
           channel_mask=SetPixelChannelMask(image,channel);
           if (attribute_flag[8] == 0) /* no rotate */
-            CompositeImage(image,compose,composite_image,geometry.x,geometry.y);
+            CompositeImage(image,compose,composite_image,geometry.x,geometry.y,
+              exception);
           else
             {
               /*
@@ -8366,7 +8442,8 @@ Mogrify(ref,...)
                 composite_image->columns)/2;
               geometry.y-=(ssize_t) (rotate_image->rows-
                 composite_image->rows)/2;
-              CompositeImage(image,compose,rotate_image,geometry.x,geometry.y);
+              CompositeImage(image,compose,rotate_image,geometry.x,geometry.y,
+                exception);
               rotate_image=DestroyImage(rotate_image);
             }
           if (attribute_flag[10] != 0) /* mask */
@@ -8438,16 +8515,16 @@ Mogrify(ref,...)
             }
           if (attribute_flag[3] != 0)
             {
-              (void) QueryColorDatabase(argument_list[3].string_reference,
-                &draw_info->stroke,exception);
+              (void) QueryColorCompliance(argument_list[3].string_reference,
+                AllCompliance,&draw_info->stroke,exception);
               if (argument_list[3].image_reference != (Image *) NULL)
                 draw_info->stroke_pattern=CloneImage(
                   argument_list[3].image_reference,0,0,MagickTrue,exception);
             }
           if (attribute_flag[4] != 0)
             {
-              (void) QueryColorDatabase(argument_list[4].string_reference,
-                &draw_info->fill,exception);
+              (void) QueryColorCompliance(argument_list[4].string_reference,
+                AllCompliance,&draw_info->fill,exception);
               if (argument_list[4].image_reference != (Image *) NULL)
                 draw_info->fill_pattern=CloneImage(
                   argument_list[4].image_reference,0,0,MagickTrue,exception);
@@ -8458,8 +8535,8 @@ Mogrify(ref,...)
             (void) CloneString(&draw_info->font,
               argument_list[6].string_reference);
           if (attribute_flag[7] != 0)
-            (void) QueryColorDatabase(argument_list[7].string_reference,
-              &draw_info->border_color,exception);
+            (void) QueryColorCompliance(argument_list[7].string_reference,
+              AllCompliance,&draw_info->border_color,exception);
           if (attribute_flag[8] != 0)
             draw_info->affine.tx=argument_list[8].real_reference;
           if (attribute_flag[9] != 0)
@@ -8601,7 +8678,7 @@ Mogrify(ref,...)
                 }
             }
           if (attribute_flag[23] != 0)
-            image->interpolate=(InterpolatePixelMethod)
+            image->interpolate=(PixelInterpolateMethod)
               argument_list[23].integer_reference;
           if ((attribute_flag[24] != 0) &&
               (draw_info->fill_pattern != (Image *) NULL))
@@ -8664,7 +8741,7 @@ Mogrify(ref,...)
                 (double) argument_list[4].real_reference);
               argument_list[0].string_reference=message;
             }
-          (void) GammaImage(image,InterpretLocaleValue(
+          (void) GammaImage(image,StringToDouble(
             argument_list[0].string_reference,(char **) NULL),exception);
           break;
         }
@@ -8702,6 +8779,9 @@ Mogrify(ref,...)
           PixelInfo
             target;
 
+          Quantum
+            virtual_pixel[MaxPixelChannels];
+
           draw_info=CloneDrawInfo(info ? info->image_info : (ImageInfo *) NULL,
             (DrawInfo *) NULL);
           if (attribute_flag[0] != 0)
@@ -8712,18 +8792,23 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry.y=argument_list[2].integer_reference;
           if (image->matte == MagickFalse)
-            (void) SetImageOpacity(image,OpaqueAlpha);
-          (void) GetOneVirtualMagickPixel(image,geometry.x,geometry.y,&target,
+            (void) SetImageAlpha(image,OpaqueAlpha,exception);
+          (void) GetOneVirtualPixel(image,geometry.x,geometry.y,virtual_pixel,
             exception);
+          target.red=virtual_pixel[RedPixelChannel];
+          target.green=virtual_pixel[GreenPixelChannel];
+          target.blue=virtual_pixel[BluePixelChannel];
+          target.alpha=virtual_pixel[AlphaPixelChannel];
           if (attribute_flag[4] != 0)
-            QueryMagickColor(argument_list[4].string_reference,&target,
-              exception);
+            QueryColorCompliance(argument_list[4].string_reference,
+              AllCompliance,&target,exception);
           if (attribute_flag[3] != 0)
-            target.alpha=SiPrefixToDouble(argument_list[3].string_reference,
-              QuantumRange);
+            target.alpha=StringToDoubleInterval(
+              argument_list[3].string_reference,(double) (double) QuantumRange+
+              1.0);
           if (attribute_flag[5] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[5].string_reference,(double) QuantumRange+1.0);
           invert=MagickFalse;
           if (attribute_flag[6] != 0)
             invert=(MagickBooleanType) argument_list[6].integer_reference;
@@ -8806,17 +8891,19 @@ Mogrify(ref,...)
             fill_color,
             target;
 
-          (void) QueryMagickColor("none",&target,exception);
-          (void) QueryMagickColor("none",&fill_color,exception);
+          (void) QueryColorCompliance("none",AllCompliance,&target,
+             exception);
+          (void) QueryColorCompliance("none",AllCompliance,&fill_color,
+            exception);
           if (attribute_flag[0] != 0)
-            (void) QueryMagickColor(argument_list[0].string_reference,
-              &target,exception);
+            (void) QueryColorCompliance(argument_list[0].string_reference,
+              AllCompliance,&target,exception);
           if (attribute_flag[1] != 0)
-            (void) QueryMagickColor(argument_list[1].string_reference,
-              &fill_color,exception);
+            (void) QueryColorCompliance(argument_list[1].string_reference,
+              AllCompliance,&fill_color,exception);
           if (attribute_flag[2] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[2].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[2].string_reference,(double) QuantumRange+1.0);
           if (attribute_flag[3] != 0)
             channel=(ChannelType) argument_list[3].integer_reference;
           invert=MagickFalse;
@@ -8847,10 +8934,11 @@ Mogrify(ref,...)
               MagickTrue : MagickFalse;
           if (attribute_flag[4] != 0)
             quantize_info->measure_error=
-              argument_list[4].integer_reference != 0 ? MagickTrue : MagickFalse;
+              argument_list[4].integer_reference != 0 ? MagickTrue :
+              MagickFalse;
           if (attribute_flag[5] != 0)
-            (void) QueryColorDatabase(argument_list[5].string_reference,
-              &image->transparent_color,exception);
+            (void) QueryColorCompliance(argument_list[5].string_reference,
+              AllCompliance,&image->transparent_color,exception);
           if (attribute_flag[5] && argument_list[5].integer_reference)
             {
               (void) QuantizeImages(quantize_info,image,exception);
@@ -8933,21 +9021,21 @@ Mogrify(ref,...)
             flags=ParseGeometry(argument_list[0].string_reference,
               &geometry_info);
           if (attribute_flag[1] != 0)
-            geometry_info.rho=SiPrefixToDouble(
-             argument_list[1].string_reference,QuantumRange);
+            geometry_info.rho=StringToDoubleInterval(
+              argument_list[1].string_reference,(double) QuantumRange+1.0);
           (void) SolarizeImage(image,geometry_info.rho,exception);
           break;
         }
         case 53:  /* Sync */
         {
-          (void) SyncImage(image);
+          (void) SyncImage(image,exception);
           break;
         }
         case 54:  /* Texture */
         {
           if (attribute_flag[0] == 0)
             break;
-          TextureImage(image,argument_list[0].image_reference);
+          TextureImage(image,argument_list[0].image_reference,exception);
           break;
         }
         case 55:  /* Evalute */
@@ -8979,17 +9067,18 @@ Mogrify(ref,...)
           PixelInfo
             target;
 
-          (void) QueryMagickColor("none",&target,exception);
+          (void) QueryColorCompliance("none",AllCompliance,&target,
+            exception);
           if (attribute_flag[0] != 0)
-            (void) QueryMagickColor(argument_list[0].string_reference,&target,
-              exception);
+            (void) QueryColorCompliance(argument_list[0].string_reference,
+              AllCompliance,&target,exception);
           opacity=TransparentAlpha;
           if (attribute_flag[1] != 0)
-            opacity=SiPrefixToDouble(argument_list[1].string_reference,
-              QuantumRange);
+            opacity=StringToDoubleInterval(argument_list[1].string_reference,
+              (double) QuantumRange+1.0);
           if (attribute_flag[2] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[2].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[2].string_reference,(double) QuantumRange+1.0);
           if (attribute_flag[3] == 0)
             argument_list[3].integer_reference=0;
           invert=MagickFalse;
@@ -9008,10 +9097,10 @@ Mogrify(ref,...)
             argument_list[0].string_reference="50%";
           if (attribute_flag[1] != 0)
             channel=(ChannelType) argument_list[1].integer_reference;
-          threshold=SiPrefixToDouble(argument_list[0].string_reference,
-            QuantumRange);
+          threshold=StringToDoubleInterval(argument_list[0].string_reference,
+            (double) QuantumRange+1.0);
           channel_mask=SetPixelChannelMask(image,channel);
-          (void) BilevelImage(image,threshold);
+          (void) BilevelImage(image,threshold,exception);
           (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
@@ -9028,20 +9117,25 @@ Mogrify(ref,...)
             geometry_info.rho=argument_list[1].real_reference;
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
+          if (attribute_flag[3] != 0)
+            geometry_info.xi=argument_list[3].real_reference;
           image=CharcoalImage(image,geometry_info.rho,geometry_info.sigma,
-            exception);
+            geometry_info.xi,exception);
           break;
         }
         case 59:  /* Trim */
         {
           if (attribute_flag[0] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[0].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[0].string_reference,(double) QuantumRange+1.0);
           image=TrimImage(image,exception);
           break;
         }
         case 60:  /* Wave */
         {
+          PixelInterpolateMethod
+            method;
+
           if (attribute_flag[0] != 0)
             {
               flags=ParseGeometry(argument_list[0].string_reference,
@@ -9053,11 +9147,11 @@ Mogrify(ref,...)
             geometry_info.rho=argument_list[1].real_reference;
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
+          method=UndefinedInterpolatePixel;
           if (attribute_flag[3] != 0)
-            image->interpolate=(InterpolatePixelMethod)
-              argument_list[3].integer_reference;
+            method=(PixelInterpolateMethod) argument_list[3].integer_reference;
           image=WaveImage(image,geometry_info.rho,geometry_info.sigma,
-            exception);
+            method,exception);
           break;
         }
         case 61:  /* Separate */
@@ -9065,7 +9159,7 @@ Mogrify(ref,...)
           if (attribute_flag[0] != 0)
             channel=(ChannelType) argument_list[0].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
-          (void) SeparateImage(image);
+          (void) SeparateImage(image,exception);
           (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
@@ -9118,10 +9212,12 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
-            channel=(ChannelType) argument_list[3].integer_reference;
+            geometry_info.xi=argument_list[3].real_reference;
+          if (attribute_flag[4] != 0)
+            channel=(ChannelType) argument_list[4].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=GaussianBlurImage(image,geometry_info.rho,geometry_info.sigma,
-            exception);
+            geometry_info.xi,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -9149,7 +9245,7 @@ Mogrify(ref,...)
               order=(size_t) sqrt(av_len(av)+1);
               kernel->width=order;
               kernel->height=order;
-              kernel->values=(double *) AcquireQuantumMemory(order,order*
+              kernel->values=(double *) AcquireAlignedMemory(order,order*
                 sizeof(*kernel->values));
               if (kernel->values == (double *) NULL)
                 {
@@ -9166,8 +9262,8 @@ Mogrify(ref,...)
           if (attribute_flag[1] != 0)
             channel=(ChannelType) argument_list[1].integer_reference;
           if (attribute_flag[2] != 0)
-            image->bias=SiPrefixToDouble(argument_list[2].string_reference,
-              QuantumRange);
+            image->bias=StringToDoubleInterval(
+              argument_list[2].string_reference,(double) QuantumRange+1.0);
           if (attribute_flag[3] != 0)
             {
               kernel=AcquireKernelInfo(argument_list[3].string_reference);
@@ -9213,7 +9309,7 @@ Mogrify(ref,...)
                     Remove a profile from the image.
                   */
                   (void) ProfileImage(image,name,(const unsigned char *) NULL,0,
-                    MagickTrue);
+                    exception);
                   break;
                 }
               /*
@@ -9223,7 +9319,7 @@ Mogrify(ref,...)
               SetStringInfoDatum(profile,(const unsigned char *)
                 argument_list[1].string_reference);
               (void) ProfileImage(image,name,GetStringInfoDatum(profile),
-                (size_t) GetStringInfoLength(profile),MagickFalse);
+                (size_t) GetStringInfoLength(profile),exception);
               profile=DestroyStringInfo(profile);
               break;
             }
@@ -9233,7 +9329,7 @@ Mogrify(ref,...)
           profile_info=
             CloneImageInfo(info ? info->image_info : (ImageInfo *) NULL);
           (void) CopyMagickString(profile_info->filename,name,MaxTextExtent);
-          profile_image=ReadImages(profile_info,&image->exception);
+          profile_image=ReadImages(profile_info,exception);
           if (profile_image == (Image *) NULL)
             break;
           ResetImageProfileIterator(profile_image);
@@ -9246,7 +9342,7 @@ Mogrify(ref,...)
             profile=GetImageProfile(profile_image,name);
             if (profile != (const StringInfo *) NULL)
               (void) ProfileImage(image,name,GetStringInfoDatum(profile),
-                (size_t) GetStringInfoLength(profile),MagickFalse);
+                (size_t) GetStringInfoLength(profile),exception);
             name=GetNextImageProfile(profile_image);
           }
           profile_image=DestroyImage(profile_image);
@@ -9301,10 +9397,12 @@ Mogrify(ref,...)
           if (attribute_flag[3] != 0)
             geometry_info.xi=argument_list[3].real_reference;
           if (attribute_flag[4] != 0)
-            channel=(ChannelType) argument_list[4].integer_reference;
+            geometry_info.psi=argument_list[4].real_reference;
+          if (attribute_flag[5] != 0)
+            channel=(ChannelType) argument_list[5].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=MotionBlurImage(image,geometry_info.rho,geometry_info.sigma,
-            geometry_info.xi,exception);
+            geometry_info.xi,geometry_info.psi,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -9499,11 +9597,11 @@ Mogrify(ref,...)
               current.rx*affine.tx+current.sy*affine.ty+current.ty;
           }
           if (attribute_flag[6] != 0)
-            image->interpolate=(InterpolatePixelMethod)
+            image->interpolate=(PixelInterpolateMethod)
               argument_list[6].integer_reference;
           if (attribute_flag[7] != 0)
-            QueryColorDatabase(argument_list[7].string_reference,
-              &image->background_color,exception);
+            QueryColorCompliance(argument_list[7].string_reference,
+              AllCompliance,&image->background_color,exception);
           image=AffineTransformImage(image,&draw_info->affine,exception);
           draw_info=DestroyDrawInfo(draw_info);
           break;
@@ -9517,8 +9615,8 @@ Mogrify(ref,...)
               goto PerlException;
             }
           if (attribute_flag[1] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[1].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[1].string_reference,(double) QuantumRange+1.0);
           (void) IsImagesEqual(image,argument_list[0].image_reference,
             exception);
           break;
@@ -9567,16 +9665,16 @@ Mogrify(ref,...)
           if (attribute_flag[5] != 0)
             argument_list[5].real_reference=1.0;
           width=(size_t) (geometry_info.rho*image->columns/
-            (image->x_resolution == 0.0 ? 72.0 : image->x_resolution)+0.5);
+            (image->resolution.x == 0.0 ? 72.0 : image->resolution.x)+0.5);
           height=(size_t) (geometry_info.sigma*image->rows/
-            (image->y_resolution == 0.0 ? 72.0 : image->y_resolution)+0.5);
+            (image->resolution.y == 0.0 ? 72.0 : image->resolution.y)+0.5);
           image=ResizeImage(image,width,height,(FilterTypes)
             argument_list[3].integer_reference,argument_list[5].real_reference,
             exception);
           if (image != (Image *) NULL)
             {
-              image->x_resolution=geometry_info.rho;
-              image->y_resolution=geometry_info.sigma;
+              image->resolution.x=geometry_info.rho;
+              image->resolution.y=geometry_info.sigma;
             }
           break;
         }
@@ -9621,15 +9719,16 @@ Mogrify(ref,...)
             {
               flags=ParseGeometry(argument_list[0].string_reference,
                 &geometry_info);
-              if ((flags & SigmaValue) == 0)
-                geometry_info.sigma=1.0;
             }
           if (attribute_flag[1] != 0)
             geometry_info.rho=argument_list[1].real_reference;
           if (attribute_flag[2] != 0)
-            channel=(ChannelType) argument_list[2].integer_reference;
+            geometry_info.sigma=argument_list[2].real_reference;
+          if (attribute_flag[3] != 0)
+            channel=(ChannelType) argument_list[3].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
-          image=RadialBlurImage(image,geometry_info.rho,exception);
+          image=RadialBlurImage(image,geometry_info.rho,geometry_info.sigma,
+            exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -9648,21 +9747,21 @@ Mogrify(ref,...)
         }
         case 84:  /* Strip */
         {
-          (void) StripImage(image);
+          (void) StripImage(image,exception);
           break;
         }
         case 85:  /* Tint */
         {
-          PixelPacket
-            target;
+          PixelInfo
+            tint;
 
-          (void) GetOneVirtualPixel(image,0,0,&target,exception);
+          GetPixelInfo(image,&tint);
           if (attribute_flag[0] != 0)
-            (void) QueryColorDatabase(argument_list[0].string_reference,&target,
-              exception);
+            (void) QueryColorCompliance(argument_list[0].string_reference,
+              AllCompliance,&tint,exception);
           if (attribute_flag[1] == 0)
             argument_list[1].string_reference="100";
-          image=TintImage(image,argument_list[1].string_reference,target,
+          image=TintImage(image,argument_list[1].string_reference,&tint,
             exception);
           break;
         }
@@ -9671,7 +9770,7 @@ Mogrify(ref,...)
           if (attribute_flag[0] != 0)
             channel=(ChannelType) argument_list[0].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
-          (void) SeparateImage(image);
+          (void) SeparateImage(image,exception);
           (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
@@ -9689,11 +9788,11 @@ Mogrify(ref,...)
           if (attribute_flag[4] != 0)
             geometry.y=argument_list[4].integer_reference;
           if (attribute_flag[5] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[5].string_reference,(double) QuantumRange+1.0);
           if (attribute_flag[6] != 0)
-            (void) QueryColorDatabase(argument_list[6].string_reference,
-              &image->background_color,exception);
+            (void) QueryColorCompliance(argument_list[6].string_reference,
+              AllCompliance,&image->background_color,exception);
           if (attribute_flag[7] != 0)
             image->gravity=(GravityType) argument_list[7].integer_reference;
           image=SpliceImage(image,&geometry,exception);
@@ -9814,11 +9913,11 @@ Mogrify(ref,...)
           if (attribute_flag[4] != 0)
             geometry.y=argument_list[4].integer_reference;
           if (attribute_flag[5] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[5].string_reference,(double) QuantumRange+1.0);
           if (attribute_flag[6] != 0)
-            (void) QueryColorDatabase(argument_list[6].string_reference,
-              &image->background_color,exception);
+            (void) QueryColorCompliance(argument_list[6].string_reference,
+              AllCompliance,&image->background_color,exception);
           image=ExtentImage(image,&geometry,exception);
           break;
         }
@@ -9844,8 +9943,8 @@ Mogrify(ref,...)
           if (attribute_flag[4] != 0)
             geometry_info.psi=argument_list[4].integer_reference;
           if (attribute_flag[5] != 0)
-            (void) QueryColorDatabase(argument_list[5].string_reference,
-              &image->background_color,exception);
+            (void) QueryColorCompliance(argument_list[5].string_reference,
+              AllCompliance,&image->background_color,exception);
           image=VignetteImage(image,geometry_info.rho,geometry_info.sigma,
             (ssize_t) ceil(geometry_info.xi-0.5),(ssize_t) ceil(geometry_info.psi-
             0.5),exception);
@@ -9901,16 +10000,20 @@ Mogrify(ref,...)
                 &geometry_info);
               if ((flags & SigmaValue) == 0)
                 geometry_info.sigma=1.0;
+              if ((flags & XiValue) == 0)
+                geometry_info.xi=0.0;
             }
           if (attribute_flag[1] != 0)
             geometry_info.rho=argument_list[1].real_reference;
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
-            channel=(ChannelType) argument_list[3].integer_reference;
+            geometry_info.xi=argument_list[3].real_reference;
+          if (attribute_flag[4] != 0)
+            channel=(ChannelType) argument_list[4].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=AdaptiveSharpenImage(image,geometry_info.rho,
-            geometry_info.sigma,exception);
+            geometry_info.sigma,geometry_info.xi,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -9977,16 +10080,20 @@ Mogrify(ref,...)
                 &geometry_info);
               if ((flags & SigmaValue) == 0)
                 geometry_info.sigma=1.0;
+              if ((flags & XiValue) == 0)
+                geometry_info.xi=0.0;
             }
           if (attribute_flag[1] != 0)
             geometry_info.rho=argument_list[1].real_reference;
           if (attribute_flag[2] != 0)
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
-            channel=(ChannelType) argument_list[3].integer_reference;
+            geometry_info.xi=argument_list[3].real_reference;
+          if (attribute_flag[4] != 0)
+            channel=(ChannelType) argument_list[4].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=AdaptiveBlurImage(image,geometry_info.rho,geometry_info.sigma,
-            exception);
+            geometry_info.xi,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -10008,8 +10115,10 @@ Mogrify(ref,...)
             geometry_info.sigma=argument_list[2].real_reference;
           if (attribute_flag[3] != 0)
             geometry_info.xi=argument_list[3].real_reference;
+          if (attribute_flag[4] != 0)
+            geometry_info.psi=argument_list[4].real_reference;
           image=SketchImage(image,geometry_info.rho,geometry_info.sigma,
-            geometry_info.xi,exception);
+            geometry_info.xi,geometry_info.psi,exception);
           break;
         }
         case 104:  /* UniqueColors */
@@ -10019,6 +10128,9 @@ Mogrify(ref,...)
         }
         case 105:  /* AdaptiveResize */
         {
+          PixelInterpolateMethod
+            method;
+
           if (attribute_flag[0] != 0)
             flags=ParseRegionGeometry(image,argument_list[0].string_reference,
               &geometry,exception);
@@ -10033,8 +10145,11 @@ Mogrify(ref,...)
               argument_list[4].string_reference);
           if (attribute_flag[5] != 0)
             image->blur=argument_list[5].real_reference;
+          method=UndefinedInterpolatePixel;
+          if (attribute_flag[6] != 0)
+            method=(PixelInterpolateMethod) argument_list[6].integer_reference;
           image=AdaptiveResizeImage(image,geometry.width,geometry.height,
-            exception);
+            method,exception);
           break;
         }
         case 106:  /* ClipMask */
@@ -10079,6 +10194,48 @@ Mogrify(ref,...)
           (void) LinearStretchImage(image,black_point,white_point,exception);
           break;
         }
+        case 108:  /* ColorMatrix */
+        {
+          AV
+            *av;
+
+          double
+            *color_matrix;
+
+          KernelInfo
+            *kernel_info;
+
+          size_t
+            order;
+
+          if (attribute_flag[0] == 0)
+            break;
+          av=(AV *) argument_list[0].array_reference;
+          order=(size_t) sqrt(av_len(av)+1);
+          color_matrix=(double *) AcquireQuantumMemory(order,order*
+            sizeof(*color_matrix));
+          if (color_matrix == (double *) NULL)
+            {
+              ThrowPerlException(exception,ResourceLimitFatalError,
+                "MemoryAllocationFailed",PackageName);
+              goto PerlException;
+           }
+          for (j=0; (j < (ssize_t) (order*order)) && (j < (av_len(av)+1)); j++)
+            color_matrix[j]=(double) SvNV(*(av_fetch(av,j,0)));
+          for ( ; j < (ssize_t) (order*order); j++)
+            color_matrix[j]=0.0;
+          kernel_info=AcquireKernelInfo((const char *) NULL);
+          if (kernel_info == (KernelInfo *) NULL)
+            break;
+          kernel_info->width=order;
+          kernel_info->height=order;
+          kernel_info->values=color_matrix;
+          image=ColorMatrixImage(image,kernel_info,exception);
+          kernel_info->values=(double *) NULL;
+          kernel_info=DestroyKernelInfo(kernel_info);
+          color_matrix=(double *) RelinquishMagickMemory(color_matrix);
+          break;
+        }
         case 109:  /* Mask */
         {
           if (attribute_flag[0] == 0)
@@ -10100,12 +10257,15 @@ Mogrify(ref,...)
           double
             angle;
 
+          PixelInterpolateMethod
+            method;
+
           draw_info=CloneDrawInfo(info ? info->image_info : (ImageInfo *) NULL,
             (DrawInfo *) NULL);
           if (attribute_flag[0] != 0)
             (void) SetImageProperty(image,"caption",InterpretImageProperties(
               info ? info->image_info : (ImageInfo *) NULL,image,
-              argument_list[0].string_reference,exception));
+              argument_list[0].string_reference,exception),exception);
           angle=0.0;
           if (attribute_flag[1] != 0)
             angle=argument_list[1].real_reference;
@@ -10113,11 +10273,11 @@ Mogrify(ref,...)
             (void) CloneString(&draw_info->font,
               argument_list[2].string_reference);
           if (attribute_flag[3] != 0)
-            (void) QueryColorDatabase(argument_list[3].string_reference,
-              &draw_info->stroke,exception);
+            (void) QueryColorCompliance(argument_list[3].string_reference,
+              AllCompliance,&draw_info->stroke,exception);
           if (attribute_flag[4] != 0)
-            (void) QueryColorDatabase(argument_list[4].string_reference,
-              &draw_info->fill,exception);
+            (void) QueryColorCompliance(argument_list[4].string_reference,
+              AllCompliance,&draw_info->fill,exception);
           if (attribute_flag[5] != 0)
             draw_info->stroke_width=argument_list[5].real_reference;
           if (attribute_flag[6] != 0)
@@ -10125,9 +10285,12 @@ Mogrify(ref,...)
           if (attribute_flag[7] != 0)
             draw_info->gravity=(GravityType) argument_list[7].integer_reference;
           if (attribute_flag[8] != 0)
-            (void) QueryColorDatabase(argument_list[8].string_reference,
-              &image->background_color,exception);
-          image=PolaroidImage(image,draw_info,angle,exception);
+            (void) QueryColorCompliance(argument_list[8].string_reference,
+              AllCompliance,&image->background_color,exception);
+          method=UndefinedInterpolatePixel;
+          if (attribute_flag[9] != 0)
+            method=(PixelInterpolateMethod) argument_list[9].integer_reference;
+          image=PolaroidImage(image,draw_info,angle,method,exception);
           draw_info=DestroyDrawInfo(draw_info);
           break;
         }
@@ -10142,6 +10305,9 @@ Mogrify(ref,...)
           PixelInfo
             target;
 
+          Quantum
+            virtual_pixel[MaxPixelChannels];
+
           draw_info=CloneDrawInfo(info ? info->image_info :
             (ImageInfo *) NULL,(DrawInfo *) NULL);
           if (attribute_flag[0] != 0)
@@ -10152,16 +10318,20 @@ Mogrify(ref,...)
           if (attribute_flag[2] != 0)
             geometry.y=argument_list[2].integer_reference;
           if (attribute_flag[3] != 0)
-            (void) QueryColorDatabase(argument_list[3].string_reference,
-              &draw_info->fill,exception);
-          (void) GetOneVirtualMagickPixel(image,geometry.x,geometry.y,&target,
+            (void) QueryColorCompliance(argument_list[3].string_reference,
+              AllCompliance,&draw_info->fill,exception);
+          (void) GetOneVirtualPixel(image,geometry.x,geometry.y,virtual_pixel,
             exception);
+          target.red=virtual_pixel[RedPixelChannel];
+          target.green=virtual_pixel[GreenPixelChannel];
+          target.blue=virtual_pixel[BluePixelChannel];
+          target.alpha=virtual_pixel[AlphaPixelChannel];
           if (attribute_flag[4] != 0)
-            QueryMagickColor(argument_list[4].string_reference,&target,
-              exception);
+            QueryColorCompliance(argument_list[4].string_reference,
+              AllCompliance,&target,exception);
           if (attribute_flag[5] != 0)
-            image->fuzz=SiPrefixToDouble(argument_list[5].string_reference,
-              QuantumRange);
+            image->fuzz=StringToDoubleInterval(
+              argument_list[5].string_reference,(double) QuantumRange+1.0);
           if (attribute_flag[6] != 0)
             channel=(ChannelType) argument_list[6].integer_reference;
           invert=MagickFalse;
@@ -10222,16 +10392,23 @@ Mogrify(ref,...)
         }
         case 113:  /* Clut */
         {
+          PixelInterpolateMethod
+            method;
+
           if (attribute_flag[0] == 0)
             {
               ThrowPerlException(exception,OptionError,"ClutImageRequired",
                 PackageName);
               goto PerlException;
             }
+          method=UndefinedInterpolatePixel;
           if (attribute_flag[1] != 0)
-            channel=(ChannelType) argument_list[1].integer_reference;
+            method=(PixelInterpolateMethod) argument_list[1].integer_reference;
+          if (attribute_flag[2] != 0)
+            channel=(ChannelType) argument_list[2].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
-          (void) ClutImage(image,argument_list[0].image_reference,exception);
+          (void) ClutImage(image,argument_list[0].image_reference,method,
+            exception);
           (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
@@ -10272,8 +10449,8 @@ Mogrify(ref,...)
             flags=ParseGeometry(argument_list[0].string_reference,
               &geometry_info);
           if (attribute_flag[1] != 0)
-            geometry_info.rho=SiPrefixToDouble(
-              argument_list[1].string_reference,QuantumRange);
+            geometry_info.rho=StringToDoubleInterval(
+              argument_list[1].string_reference,(double) QuantumRange+1.0);
           image=DeskewImage(image,geometry_info.rho,exception);
           break;
         }
@@ -10413,10 +10590,12 @@ Mogrify(ref,...)
           if (attribute_flag[3] != 0)
             geometry_info.xi=argument_list[3].integer_reference;;
           if (attribute_flag[4] != 0)
-            channel=(ChannelType) argument_list[4].integer_reference;
+            geometry_info.psi=argument_list[4].integer_reference;;
+          if (attribute_flag[5] != 0)
+            channel=(ChannelType) argument_list[5].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=SelectiveBlurImage(image,geometry_info.rho,geometry_info.sigma,
-            geometry_info.xi,exception);
+            geometry_info.xi,geometry_info.psi,exception);
           if (image != (Image *) NULL)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
@@ -10491,14 +10670,18 @@ Mogrify(ref,...)
             black_point,
             white_point;
 
-          (void) QueryMagickColor("#000000",&black_point,exception);
-          (void) QueryMagickColor("#ffffff",&white_point,exception);
+          (void) QueryColorCompliance("#000000",AllCompliance,
+            &black_point,exception);
+          (void) QueryColorCompliance("#ffffff",AllCompliance,
+            &white_point,exception);
           if (attribute_flag[1] != 0)
-             (void) QueryMagickColor(argument_list[1].string_reference,
-               &black_point,exception);
+             (void) QueryColorCompliance(
+               argument_list[1].string_reference,AllCompliance,&black_point,
+               exception);
           if (attribute_flag[2] != 0)
-             (void) QueryMagickColor(argument_list[2].string_reference,
-               &white_point,exception);
+             (void) QueryColorCompliance(
+               argument_list[2].string_reference,AllCompliance,&white_point,
+               exception);
           if (attribute_flag[3] != 0)
             channel=(ChannelType) argument_list[3].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
@@ -10513,11 +10696,11 @@ Mogrify(ref,...)
           if (attribute_flag[0] != 0)
             channel=(ChannelType) argument_list[0].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
-          (void) ClampImage(image);
+          (void) ClampImage(image,exception);
           (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
-        case 132:  /* BrightnessContrast */
+        case 131:  /* BrightnessContrast */
         {
           double
             brightness,
@@ -10544,7 +10727,7 @@ Mogrify(ref,...)
           (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
-        case 133:  /* Morphology */
+        case 132:  /* Morphology */
         {
           KernelInfo
             *kernel;
@@ -10567,7 +10750,7 @@ Mogrify(ref,...)
             method=argument_list[2].integer_reference;
           iterations=1;
           if (attribute_flag[3] != 0)
-            iterations=argument_list[4].integer_reference;
+            iterations=argument_list[3].integer_reference;
           channel_mask=SetPixelChannelMask(image,channel);
           image=MorphologyImage(image,method,iterations,kernel,exception);
           if (image != (Image *) NULL)
@@ -10575,64 +10758,7 @@ Mogrify(ref,...)
           kernel=DestroyKernelInfo(kernel);
           break;
         }
-        case 108:  /* Recolor */
-        case 134:  /* ColorMatrix */
-        {
-          AV
-            *av;
-
-          double
-            *color_matrix;
-
-          KernelInfo
-            *kernel_info;
-
-          size_t
-            order;
-
-          if (attribute_flag[0] == 0)
-            break;
-          av=(AV *) argument_list[0].array_reference;
-          if (av == (AV *) NULL)
-            break;
-          order=(size_t) sqrt(av_len(av)+1);
-          color_matrix=(double *) AcquireQuantumMemory(order,order*
-            sizeof(*color_matrix));
-          if (color_matrix == (double *) NULL)
-            {
-              ThrowPerlException(exception,ResourceLimitFatalError,
-                "MemoryAllocationFailed",PackageName);
-              goto PerlException;
-           }
-          for (j=0; (j < (ssize_t) (order*order)) && (j < (av_len(av)+1)); j++)
-            color_matrix[j]=(double) SvNV(*(av_fetch(av,j,0)));
-          for ( ; j < (ssize_t) (order*order); j++)
-            color_matrix[j]=0.0;
-          kernel_info=AcquireKernelInfo((const char *) NULL);
-          if (kernel_info == (KernelInfo *) NULL)
-            break;
-          kernel_info->width=order;
-          kernel_info->height=order;
-          kernel_info->values=color_matrix;
-          image=ColorMatrixImage(image,kernel_info,exception);
-          kernel_info->values=(double *) NULL;
-          kernel_info=DestroyKernelInfo(kernel_info);
-          color_matrix=(double *) RelinquishMagickMemory(color_matrix);
-          break;
-        }
-        case 135:  /* Color */
-        {
-          PixelInfo
-            color;
-
-          (void) QueryMagickColor("none",&color,exception);
-          if (attribute_flag[0] != 0)
-            (void) QueryMagickColor(argument_list[0].string_reference,
-              &color,exception);
-          (void) SetImageColor(image,&color);
-          break;
-        }
-        case 136:  /* Mode */
+        case 133:  /* Mode */
         {
           if (attribute_flag[0] != 0)
             {
@@ -10654,7 +10780,7 @@ Mogrify(ref,...)
             (void) SetPixelChannelMask(image,channel_mask);
           break;
         }
-        case 137:  /* Statistic */
+        case 134:  /* Statistic */
         {
           StatisticType
             statistic;
@@ -10691,7 +10817,7 @@ Mogrify(ref,...)
             Composite region.
           */ 
           status=CompositeImage(region_image,CopyCompositeOp,image,
-            region_info.x,region_info.y);
+            region_info.x,region_info.y,exception);
           (void) status;
           (void) CatchImageException(region_image);
           image=DestroyImage(image);
@@ -10813,7 +10939,8 @@ Montage(ref,...)
     */
     info=GetPackageInfo(aTHX_ (void *) av,info,exception);
     montage_info=CloneMontageInfo(info->image_info,(MontageInfo *) NULL);
-    (void) QueryMagickColor("none",&transparent_color,exception);
+    (void) QueryColorCompliance("none",AllCompliance,&transparent_color,
+      exception);
     for (i=2; i < items; i+=2)
     {
       attribute=(char *) SvPV(ST(i-1),na);
@@ -10824,7 +10951,7 @@ Montage(ref,...)
         {
           if (LocaleCompare(attribute,"background") == 0)
             {
-              (void) QueryColorDatabase(SvPV(ST(i),na),
+              (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
                 &montage_info->background_color,exception);
               for (next=image; next; next=next->next)
                 next->background_color=montage_info->background_color;
@@ -10837,7 +10964,7 @@ Montage(ref,...)
             }
           if (LocaleCompare(attribute,"bordercolor") == 0)
             {
-              (void) QueryColorDatabase(SvPV(ST(i),na),
+              (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
                 &montage_info->border_color,exception);
               for (next=image; next; next=next->next)
                 next->border_color=montage_info->border_color;
@@ -10878,8 +11005,8 @@ Montage(ref,...)
         {
           if (LocaleCompare(attribute,"fill") == 0)
             {
-              (void) QueryColorDatabase(SvPV(ST(i),na),&montage_info->fill,
-                exception);
+              (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+                &montage_info->fill,exception);
               break;
             }
           if (LocaleCompare(attribute,"font") == 0)
@@ -10958,7 +11085,7 @@ Montage(ref,...)
               for (next=image; next; next=next->next)
                 (void) SetImageProperty(next,"label",InterpretImageProperties(
                   info ? info->image_info : (ImageInfo *) NULL,next,
-                  SvPV(ST(i),na),exception));
+                  SvPV(ST(i),na),exception),exception);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -10970,7 +11097,7 @@ Montage(ref,...)
         {
           if (LocaleCompare(attribute,"mattecolor") == 0)
             {
-              (void) QueryColorDatabase(SvPV(ST(i),na),
+              (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
                 &montage_info->matte_color,exception);
               for (next=image; next; next=next->next)
                 next->matte_color=montage_info->matte_color;
@@ -10981,8 +11108,8 @@ Montage(ref,...)
               ssize_t
                 in;
 
-              in=!SvPOK(ST(i)) ? SvIV(ST(i)) :
-                ParseCommandOption(MagickModeOptions,MagickFalse,SvPV(ST(i),na));
+              in=!SvPOK(ST(i)) ? SvIV(ST(i)) : ParseCommandOption(
+                MagickModeOptions,MagickFalse,SvPV(ST(i),na));
               switch (in)
               {
                 default:
@@ -11048,8 +11175,8 @@ Montage(ref,...)
             }
           if (LocaleCompare(attribute,"stroke") == 0)
             {
-              (void) QueryColorDatabase(SvPV(ST(i),na),&montage_info->stroke,
-                exception);
+              (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+                &montage_info->stroke,exception);
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
@@ -11088,7 +11215,8 @@ Montage(ref,...)
               PixelInfo
                 transparent_color;
 
-              QueryMagickColor(SvPV(ST(i),na),&transparent_color,exception);
+              QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+                &transparent_color,exception);
               for (next=image; next; next=next->next)
                 (void) TransparentPaintImage(next,&transparent_color,
                   TransparentAlpha,MagickFalse,exception);
@@ -11342,7 +11470,7 @@ Mosaic(ref)
     info=GetPackageInfo(aTHX_ (void *) av,info,exception);
     (void) CopyMagickString(info->image_info->filename,image->filename,
       MaxTextExtent);
-    SetImageInfo(info->image_info,0,&image->exception);
+    SetImageInfo(info->image_info,0,exception);
     exception=DestroyExceptionInfo(exception);
     SvREFCNT_dec(perl_exception);
     XSRETURN(1);
@@ -11725,7 +11853,7 @@ QueryColor(ref,...)
     for (i=1; i < items; i++)
     {
       name=(char *) SvPV(ST(i),na);
-      if (QueryMagickColor(name,&color,exception) == MagickFalse)
+      if (QueryColorCompliance(name,AllCompliance,&color,exception) == MagickFalse)
         {
           PUSHs(&sv_undef);
           continue;
@@ -11776,7 +11904,7 @@ QueryColorname(ref,...)
     Image
       *image;
 
-    PixelPacket
+    PixelInfo
       target_color;
 
     register ssize_t
@@ -11807,7 +11935,8 @@ QueryColorname(ref,...)
     EXTEND(sp,items);
     for (i=1; i < items; i++)
     {
-      (void) QueryColorDatabase(SvPV(ST(i),na),&target_color,exception);
+      (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,&target_color,
+        exception);
       (void) QueryColorname(image,&target_color,SVGCompliance,message,
         exception);
       PUSHs(sv_2mortal(newSVpv(message,0)));
@@ -12097,8 +12226,8 @@ QueryFontMetrics(ref,...)
           if (LocaleCompare(attribute,"fill") == 0)
             {
               if (info)
-                (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->fill,
-                  &image->exception);
+                (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+                  &draw_info->fill,exception);
               break;
             }
           if (LocaleCompare(attribute,"font") == 0)
@@ -12219,8 +12348,8 @@ QueryFontMetrics(ref,...)
           if (LocaleCompare(attribute,"stroke") == 0)
             {
               if (info)
-                (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->stroke,
-                  &image->exception);
+                (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+                  &draw_info->stroke,exception);
               break;
             }
           if (LocaleCompare(attribute,"style") == 0)
@@ -12502,8 +12631,8 @@ QueryMultilineFontMetrics(ref,...)
           if (LocaleCompare(attribute,"fill") == 0)
             {
               if (info)
-                (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->fill,
-                  &image->exception);
+                (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+                  &draw_info->fill,exception);
               break;
             }
           if (LocaleCompare(attribute,"font") == 0)
@@ -12592,8 +12721,8 @@ QueryMultilineFontMetrics(ref,...)
           if (LocaleCompare(attribute,"stroke") == 0)
             {
               if (info)
-                (void) QueryColorDatabase(SvPV(ST(i),na),&draw_info->stroke,
-                  &image->exception);
+                (void) QueryColorCompliance(SvPV(ST(i),na),AllCompliance,
+                  &draw_info->stroke,exception);
               break;
             }
           if (LocaleCompare(attribute,"style") == 0)
@@ -13718,7 +13847,7 @@ Statistics(ref,...)
     count=0;
     for ( ; image; image=image->next)
     {
-      channel_statistics=GetImageStatistics(image,&image->exception);
+      channel_statistics=GetImageStatistics(image,exception);
       if (channel_statistics == (ChannelStatistics *) NULL)
         continue;
       count++;
@@ -13801,7 +13930,6 @@ SyncAuthenticPixels(ref,...)
     status=SyncAuthenticPixels(image,exception);
     if (status != MagickFalse)
       return;
-    InheritException(exception,&image->exception);
 
   PerlException:
     InheritPerlException(exception,perl_exception);
@@ -13954,7 +14082,7 @@ Transform(ref,...)
       clone=CloneImage(image,0,0,MagickTrue,exception);
       if ((clone == (Image *) NULL) || (exception->severity >= ErrorException))
         goto PerlException;
-      TransformImage(&clone,crop_geometry,geometry);
+      TransformImage(&clone,crop_geometry,geometry,exception);
       for ( ; clone; clone=clone->next)
       {
         AddImageToRegistry(sv,clone);
@@ -14060,7 +14188,7 @@ Write(ref,...)
       next->scene=scene++;
     }
     SetImageInfo(package_info->image_info,(unsigned int)
-      GetImageListLength(image),&image->exception);
+      GetImageListLength(image),exception);
     for (next=image; next; next=next->next)
     {
       (void) WriteImage(package_info->image_info,next,exception);