]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 5 Sep 2011 20:17:07 +0000 (20:17 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 5 Sep 2011 20:17:07 +0000 (20:17 +0000)
Magick++/lib/Image.cpp
MagickCore/effect.c
MagickCore/effect.h
MagickWand/magick-image.c
MagickWand/magick-image.h
MagickWand/mogrify.c
PerlMagick/Magick.xs

index d2cf163cd822f0e690197d634815b84a094854b5..522b1db3b9ee4173679c145f7c7b281ba4d782ee 100644 (file)
@@ -300,7 +300,7 @@ void Magick::Image::adaptiveBlur( const double radius_, const double sigma_ )
   ExceptionInfo exceptionInfo;
   GetExceptionInfo( &exceptionInfo );
   MagickCore::Image* newImage =
-    AdaptiveBlurImage( image(), radius_, sigma_, &exceptionInfo);
+    AdaptiveBlurImage( image(), radius_, sigma_, image()->bias, &exceptionInfo);
   replaceImage( newImage );
   throwException( exceptionInfo );
   (void) DestroyExceptionInfo( &exceptionInfo );
index fa49098bcecffc8d31f863b17596ecd070f075ab..8ac984b3b22dadfd1c5482992dacae2e848d25c5 100644 (file)
 %  The format of the AdaptiveBlurImage method is:
 %
 %      Image *AdaptiveBlurImage(const Image *image,const double radius,
-%        const double sigma,ExceptionInfo *exception)
+%        const double sigma,const double bias,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
 %
 %    o sigma: the standard deviation of the Laplacian, in pixels.
 %
+%    o bias: the bias.
+%
 %    o exception: return any errors or warnings in this structure.
 %
 */
@@ -166,7 +168,8 @@ MagickExport MagickBooleanType AdaptiveLevelImage(Image *image,
 }
 
 MagickExport Image *AdaptiveBlurImage(const Image *image,
-  const double radius,const double sigma,ExceptionInfo *exception)
+  const double radius,const double sigma,const double bias,
+  ExceptionInfo *exception)
 {
 #define AdaptiveBlurImageTag  "Convolve/Image"
 #define MagickSigma  (fabs(sigma) <= MagickEpsilon ? 1.0 : sigma)
@@ -191,9 +194,6 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,
   MagickOffsetType
     progress;
 
-  PixelInfo
-    bias;
-
   register ssize_t
     i;
 
@@ -291,8 +291,6 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,
   */
   status=MagickTrue;
   progress=0;
-  GetPixelInfo(image,&bias);
-  SetPixelInfoBias(image,&bias);
   image_view=AcquireCacheView(image);
   edge_view=AcquireCacheView(edge_image);
   blur_view=AcquireCacheView(blur_image);
@@ -302,7 +300,6 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,
   for (y=0; y < (ssize_t) blur_image->rows; y++)
   {
     register const Quantum
-      *restrict p,
       *restrict r;
 
     register Quantum
@@ -323,73 +320,108 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,
       }
     for (x=0; x < (ssize_t) blur_image->columns; x++)
     {
-      PixelInfo
-        pixel;
-
-      MagickRealType
-        alpha,
-        gamma;
-
-      register const double
-        *restrict k;
+      register const Quantum
+        *restrict p;
 
       register ssize_t
-        i,
-        u,
-        v;
+        i;
 
-      gamma=0.0;
-      i=(ssize_t) ceil((double) width*QuantumScale*
+      ssize_t
+        center,
+        j;
+
+      j=(ssize_t) ceil((double) width*QuantumScale*
         GetPixelIntensity(edge_image,r)-0.5);
-      if (i < 0)
-        i=0;
+      if (j < 0)
+        j=0;
       else
-        if (i > (ssize_t) width)
-          i=(ssize_t) width;
-      if ((i & 0x01) != 0)
-        i--;
-      p=GetCacheViewVirtualPixels(image_view,x-((ssize_t) (width-i)/2L),y-
-        (ssize_t) ((width-i)/2L),width-i,width-i,exception);
+        if (j > (ssize_t) width)
+          j=(ssize_t) width;
+      if ((j & 0x01) != 0)
+        j--;
+      p=GetCacheViewVirtualPixels(image_view,x-((ssize_t) (width-j)/2L),y-
+        (ssize_t) ((width-j)/2L),width-j,width-j,exception);
       if (p == (const Quantum *) NULL)
         break;
-      pixel=bias;
-      k=kernel[i];
-      for (v=0; v < (ssize_t) (width-i); v++)
+      center=(ssize_t) GetPixelChannels(image)*(width-j)*
+        ((width-j)/2L)+GetPixelChannels(image)*((width-j)/2);
+      for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
       {
-        for (u=0; u < (ssize_t) (width-i); u++)
+        MagickRealType
+          alpha,
+          gamma,
+          pixel;
+
+        PixelChannel
+          channel;
+
+        PixelTrait
+          blur_traits,
+          traits;
+
+        register const double
+          *restrict k;
+
+        register const Quantum
+          *restrict pixels;
+
+        register ssize_t
+          u;
+
+        ssize_t
+          v;
+
+        traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+        channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+        blur_traits=GetPixelChannelMapTraits(blur_image,channel);
+        if ((traits == UndefinedPixelTrait) ||
+            (blur_traits == UndefinedPixelTrait))
+          continue;
+        if ((blur_traits & CopyPixelTrait) != 0)
+          {
+            q[channel]=p[center+i];
+            continue;
+          }
+        k=kernel[j];
+        pixels=p;
+        pixel=bias;
+        gamma=0.0;
+        if ((blur_traits & BlendPixelTrait) == 0)
+          {
+            /*
+              No alpha blending.
+            */
+            for (v=0; v < (ssize_t) (width-j); v++)
+            {
+              for (u=0; u < (ssize_t) (width-j); u++)
+              {
+                pixel+=(*k)*pixels[i];
+                gamma+=(*k);
+                k++;
+                pixels+=GetPixelChannels(image);
+              }
+            }
+            gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
+            q[channel]=ClampToQuantum(gamma*pixel);
+            continue;
+          }
+        /*
+          Alpha blending.
+        */
+        for (v=0; v < (ssize_t) (width-j); v++)
         {
-          alpha=1.0;
-          if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-              (image->matte != MagickFalse))
-            alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,p));
-          if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-            pixel.red+=(*k)*alpha*GetPixelRed(image,p);
-          if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-            pixel.green+=(*k)*alpha*GetPixelGreen(image,p);
-          if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-            pixel.blue+=(*k)*alpha*GetPixelBlue(image,p);
-          if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
-              (image->colorspace == CMYKColorspace))
-            pixel.black+=(*k)*alpha*GetPixelBlack(image,p);
-          if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-            pixel.alpha+=(*k)*GetPixelAlpha(image,p);
-          gamma+=(*k)*alpha;
-          k++;
-          p+=GetPixelChannels(image);
+          for (u=0; u < (ssize_t) (width-j); u++)
+          {
+            alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,pixels));
+            pixel+=(*k)*alpha*pixels[i];
+            gamma+=(*k)*alpha;
+            k++;
+            pixels+=GetPixelChannels(image);
+          }
         }
+        gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
+        q[channel]=ClampToQuantum(gamma*pixel);
       }
-      gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
-      if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelRed(blur_image,ClampToQuantum(gamma*pixel.red),q);
-      if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelGreen(blur_image,ClampToQuantum(gamma*pixel.green),q);
-      if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelBlue(blur_image,ClampToQuantum(gamma*pixel.blue),q);
-      if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->colorspace == CMYKColorspace))
-        SetPixelBlack(blur_image,ClampToQuantum(gamma*pixel.black),q);
-      if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelAlpha(blur_image,ClampToQuantum(pixel.alpha),q);
       q+=GetPixelChannels(blur_image);
       r+=GetPixelChannels(edge_image);
     }
@@ -442,7 +474,7 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,
 %  The format of the AdaptiveSharpenImage method is:
 %
 %      Image *AdaptiveSharpenImage(const Image *image,const double radius,
-%        const double sigma,ExceptionInfo *exception)
+%        const double sigma,const double bias,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -453,11 +485,13 @@ MagickExport Image *AdaptiveBlurImage(const Image *image,
 %
 %    o sigma: the standard deviation of the Laplacian, in pixels.
 %
+%    o bias: the bias.
+%
 %    o exception: return any errors or warnings in this structure.
 %
 */
 MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius,
-  const double sigma,ExceptionInfo *exception)
+  const double sigma,const double bias,ExceptionInfo *exception)
 {
 #define AdaptiveSharpenImageTag  "Convolve/Image"
 #define MagickSigma  (fabs(sigma) <= MagickEpsilon ? 1.0 : sigma)
@@ -482,9 +516,6 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius,
   MagickOffsetType
     progress;
 
-  PixelInfo
-    bias;
-
   register ssize_t
     i;
 
@@ -582,8 +613,6 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius,
   */
   status=MagickTrue;
   progress=0;
-  GetPixelInfo(image,&bias);
-  SetPixelInfoBias(image,&bias);
   image_view=AcquireCacheView(image);
   edge_view=AcquireCacheView(edge_image);
   sharp_view=AcquireCacheView(sharp_image);
@@ -593,7 +622,6 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius,
   for (y=0; y < (ssize_t) sharp_image->rows; y++)
   {
     register const Quantum
-      *restrict p,
       *restrict r;
 
     register Quantum
@@ -614,73 +642,108 @@ MagickExport Image *AdaptiveSharpenImage(const Image *image,const double radius,
       }
     for (x=0; x < (ssize_t) sharp_image->columns; x++)
     {
-      PixelInfo
-        pixel;
-
-      MagickRealType
-        alpha,
-        gamma;
-
-      register const double
-        *restrict k;
+      register const Quantum
+        *restrict p;
 
       register ssize_t
-        i,
-        u,
-        v;
+        i;
 
-      gamma=0.0;
-      i=(ssize_t) ceil((double) width*QuantumScale*
+      ssize_t
+        center,
+        j;
+
+      j=(ssize_t) ceil((double) width*QuantumScale*
         GetPixelIntensity(edge_image,r)-0.5);
-      if (i < 0)
-        i=0;
+      if (j < 0)
+        j=0;
       else
-        if (i > (ssize_t) width)
-          i=(ssize_t) width;
-      if ((i & 0x01) != 0)
-        i--;
-      p=GetCacheViewVirtualPixels(image_view,x-((ssize_t) (width-i)/2L),y-
-        (ssize_t) ((width-i)/2L),width-i,width-i,exception);
+        if (j > (ssize_t) width)
+          j=(ssize_t) width;
+      if ((j & 0x01) != 0)
+        j--;
+      p=GetCacheViewVirtualPixels(image_view,x-((ssize_t) (width-j)/2L),y-
+        (ssize_t) ((width-j)/2L),width-j,width-j,exception);
       if (p == (const Quantum *) NULL)
         break;
-      k=kernel[i];
-      pixel=bias;
-      for (v=0; v < (ssize_t) (width-i); v++)
+      center=(ssize_t) GetPixelChannels(image)*(width-j)*
+        ((width-j)/2L)+GetPixelChannels(image)*((width-j)/2);
+      for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
       {
-        for (u=0; u < (ssize_t) (width-i); u++)
+        MagickRealType
+          alpha,
+          gamma,
+          pixel;
+
+        PixelChannel
+          channel;
+
+        PixelTrait
+          sharp_traits,
+          traits;
+
+        register const double
+          *restrict k;
+
+        register const Quantum
+          *restrict pixels;
+
+        register ssize_t
+          u;
+
+        ssize_t
+          v;
+
+        traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+        channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
+        sharp_traits=GetPixelChannelMapTraits(sharp_image,channel);
+        if ((traits == UndefinedPixelTrait) ||
+            (sharp_traits == UndefinedPixelTrait))
+          continue;
+        if ((sharp_traits & CopyPixelTrait) != 0)
+          {
+            q[channel]=p[center+i];
+            continue;
+          }
+        k=kernel[j];
+        pixels=p;
+        pixel=bias;
+        gamma=0.0;
+        if ((sharp_traits & BlendPixelTrait) == 0)
+          {
+            /*
+              No alpha blending.
+            */
+            for (v=0; v < (ssize_t) (width-j); v++)
+            {
+              for (u=0; u < (ssize_t) (width-j); u++)
+              {
+                pixel+=(*k)*pixels[i];
+                gamma+=(*k);
+                k++;
+                pixels+=GetPixelChannels(image);
+              }
+            }
+            gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
+            q[channel]=ClampToQuantum(gamma*pixel);
+            continue;
+          }
+        /*
+          Alpha blending.
+        */
+        for (v=0; v < (ssize_t) (width-j); v++)
         {
-          alpha=1.0;
-          if (((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0) &&
-              (image->matte != MagickFalse))
-            alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,p));
-          if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-            pixel.red+=(*k)*alpha*GetPixelRed(image,p);
-          if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-            pixel.green+=(*k)*alpha*GetPixelGreen(image,p);
-          if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-            pixel.blue+=(*k)*alpha*GetPixelBlue(image,p);
-          if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
-              (image->colorspace == CMYKColorspace))
-            pixel.black+=(*k)*alpha*GetPixelBlack(image,p);
-          if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-            pixel.alpha+=(*k)*GetPixelAlpha(image,p);
-          gamma+=(*k)*alpha;
-          k++;
-          p+=GetPixelChannels(image);
+          for (u=0; u < (ssize_t) (width-j); u++)
+          {
+            alpha=(MagickRealType) (QuantumScale*GetPixelAlpha(image,pixels));
+            pixel+=(*k)*alpha*pixels[i];
+            gamma+=(*k)*alpha;
+            k++;
+            pixels+=GetPixelChannels(image);
+          }
         }
+        gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
+        q[channel]=ClampToQuantum(gamma*pixel);
       }
-      gamma=1.0/(fabs((double) gamma) <= MagickEpsilon ? 1.0 : gamma);
-      if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelRed(sharp_image,ClampToQuantum(gamma*pixel.red),q);
-      if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelGreen(sharp_image,ClampToQuantum(gamma*pixel.green),q);
-      if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelBlue(sharp_image,ClampToQuantum(gamma*pixel.blue),q);
-      if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
-          (image->colorspace == CMYKColorspace))
-        SetPixelBlack(sharp_image,ClampToQuantum(gamma*pixel.black),q);
-      if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-        SetPixelAlpha(sharp_image,ClampToQuantum(pixel.alpha),q);
       q+=GetPixelChannels(sharp_image);
       r+=GetPixelChannels(edge_image);
     }
index 6d83189b874ef65cb737737abb315ec8df18ff64..1804af5dc1b7cf7e9b376db26e5da9be29420e19 100644 (file)
@@ -72,8 +72,9 @@ typedef enum
 } StatisticType;
 
 extern MagickExport Image
-  *AdaptiveBlurImage(const Image *,const double,const double,ExceptionInfo *),
-  *AdaptiveSharpenImage(const Image *,const double,const double,
+  *AdaptiveBlurImage(const Image *,const double,const double,const double,
+    ExceptionInfo *),
+  *AdaptiveSharpenImage(const Image *,const double,const double,const double,
      ExceptionInfo *),
   *BlurImage(const Image *,const double,const double,ExceptionInfo *),
   *ConvolveImage(const Image *,const KernelInfo *,ExceptionInfo *),
index 9d66efd8649a909ac9d6ad5fde21246f259e398b..2b155be91bc83da864bf6223c0edad71c6a4724b 100644 (file)
@@ -177,7 +177,7 @@ WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
 %  The format of the MagickAdaptiveBlurImage method is:
 %
 %      MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
-%        const double radius,const double sigma)
+%        const double radius,const double sigma,const double bias)
 %
 %  A description of each parameter follows:
 %
@@ -188,9 +188,11 @@ WandExport Image *GetImageFromMagickWand(const MagickWand *wand)
 %
 %    o sigma: the standard deviation of the Gaussian, in pixels.
 %
+%    o bias: the bias.
+%
 */
 WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
-  const double radius,const double sigma)
+  const double radius,const double sigma,const double bias)
 {
   Image
     *sharp_image;
@@ -201,7 +203,7 @@ WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception);
+  sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,bias,wand->exception);
   if (sharp_image == (Image *) NULL)
     return(MagickFalse);
   ReplaceImageInList(&wand->images,sharp_image);
@@ -274,7 +276,7 @@ WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
 %  The format of the MagickAdaptiveSharpenImage method is:
 %
 %      MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
-%        const double radius,const double sigma)
+%        const double radius,const double sigma,const double bias)
 %
 %  A description of each parameter follows:
 %
@@ -285,9 +287,11 @@ WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
 %
 %    o sigma: the standard deviation of the Gaussian, in pixels.
 %
+%    o bias: the bias.
+%
 */
 WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
-  const double radius,const double sigma)
+  const double radius,const double sigma,const double bias)
 {
   Image
     *sharp_image;
@@ -298,7 +302,8 @@ WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception);
+  sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,bias,
+    wand->exception);
   if (sharp_image == (Image *) NULL)
     return(MagickFalse);
   ReplaceImageInList(&wand->images,sharp_image);
index 1f3e19888f19fdd42ef9f3644d529179d5f74372..5895ec6c58299dbd86bb8303b8d3e89803349959 100644 (file)
@@ -71,9 +71,10 @@ extern WandExport InterpolatePixelMethod
   MagickGetImageInterpolateMethod(MagickWand *);
 
 extern WandExport MagickBooleanType
-  MagickAdaptiveBlurImage(MagickWand *,const double,const double),
+  MagickAdaptiveBlurImage(MagickWand *,const double,const double,const double),
   MagickAdaptiveResizeImage(MagickWand *,const size_t,const size_t),
-  MagickAdaptiveSharpenImage(MagickWand *,const double,const double),
+  MagickAdaptiveSharpenImage(MagickWand *,const double,const double,
+    const double),
   MagickAdaptiveThresholdImage(MagickWand *,const size_t,const size_t,
     const ssize_t),
   MagickAddImage(MagickWand *,const MagickWand *),
index 97ec4a789b631712ca93de607c0814a2469c3d8f..547a93b8cc43873a578f67d2b9b2fc6a56728513 100644 (file)
@@ -707,7 +707,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
             if ((flags & SigmaValue) == 0)
               geometry_info.sigma=1.0;
             mogrify_image=AdaptiveBlurImage(*image,geometry_info.rho,
-              geometry_info.sigma,exception);
+              geometry_info.sigma,geometry_info.xi,exception);
             break;
           }
         if (LocaleCompare("adaptive-resize",option+1) == 0)
@@ -731,7 +731,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
             if ((flags & SigmaValue) == 0)
               geometry_info.sigma=1.0;
             mogrify_image=AdaptiveSharpenImage(*image,geometry_info.rho,
-              geometry_info.sigma,exception);
+              geometry_info.sigma,geometry_info.xi,exception);
             break;
           }
         if (LocaleCompare("affine",option+1) == 0)
index e4ebb7560f2bbc0ae1de2734800462f4d6d518af..89df01d851ef667b140a96676344367eef7daf83 100644 (file)
@@ -455,13 +455,13 @@ 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} } },
@@ -9901,16 +9901,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 +9981,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;