]> granicus.if.org Git - imagemagick/blobdiff - wand/magick-image.c
(no commit message)
[imagemagick] / wand / magick-image.c
index 8eaad2df7ce3396ecd4bc6d3c95452f1d56065d9..620a0762dd53675dc325208037558a0a05270f0b 100644 (file)
@@ -23,7 +23,7 @@
 %                                 August 2003                                 %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -99,14 +99,14 @@ static MagickWand *CloneMagickWandFromImages(const MagickWand *wand,
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  clone_wand=(MagickWand *) AcquireAlignedMemory(1,sizeof(*clone_wand));
+  clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand));
   if (clone_wand == (MagickWand *) NULL)
     ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
       images->filename);
   (void) ResetMagickMemory(clone_wand,0,sizeof(*clone_wand));
   clone_wand->id=AcquireWandId();
-  (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%lu",
-    MagickWandId,clone_wand->id);
+  (void) FormatMagickString(clone_wand->name,MaxTextExtent,"%s-%.20g",
+    MagickWandId,(double) clone_wand->id);
   clone_wand->exception=AcquireExceptionInfo();
   InheritException(clone_wand->exception,wand->exception);
   clone_wand->image_info=CloneImageInfo(wand->image_info);
@@ -239,7 +239,7 @@ WandExport MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,
 %  triangulation.
 %
 %      MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows)
+%        const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -251,7 +251,7 @@ WandExport MagickBooleanType MagickAdaptiveBlurImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows)
+  const size_t columns,const size_t rows)
 {
   Image
     *resize_image;
@@ -356,7 +356,7 @@ WandExport MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand,
 %  The format of the AdaptiveThresholdImage method is:
 %
 %      MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long offset)
+%        const size_t width,const size_t height,const ssize_t offset)
 %
 %  A description of each parameter follows:
 %
@@ -370,7 +370,7 @@ WandExport MagickBooleanType MagickAdaptiveSharpenImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long offset)
+  const size_t width,const size_t height,const ssize_t offset)
 {
   Image
     *threshold_image;
@@ -443,6 +443,12 @@ static inline MagickBooleanType InsertImageInWand(MagickWand *wand,
           return(MagickTrue);
         }
     }
+  if (sentinel->next == (Image *) NULL)
+    {
+      InsertImageInList(&sentinel,images);
+      wand->images=GetLastImageInList(images);
+      return(MagickTrue);
+    }
   InsertImageInList(&sentinel,images);
   wand->images=GetFirstImageInList(images);
   return(MagickTrue);
@@ -851,45 +857,6 @@ WandExport MagickBooleanType MagickAutoLevelImageChannel(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k A v e r a g e I m a g e s                                     %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  MagickAverageImages() average a set of images.
-%
-%  The format of the MagickAverageImages method is:
-%
-%      MagickWand *MagickAverageImages(MagickWand *wand)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the magick wand.
-%
-*/
-WandExport MagickWand *MagickAverageImages(MagickWand *wand)
-{
-  Image
-    *average_image;
-
-  assert(wand != (MagickWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  if (wand->images == (Image *) NULL)
-    return((MagickWand *) NULL);
-  average_image=AverageImages(wand->images,wand->exception);
-  if (average_image == (Image *) NULL)
-    return((MagickWand *) NULL);
-  return(CloneMagickWandFromImages(wand,average_image));
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   M a g i c k B l a c k T h r e s h o l d I m a g e                         %
 %                                                                             %
 %                                                                             %
@@ -1065,8 +1032,8 @@ WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
 %  The format of the MagickBorderImage method is:
 %
 %      MagickBooleanType MagickBorderImage(MagickWand *wand,
-%        const PixelWand *bordercolor,const unsigned long width,
-%        const unsigned long height)
+%        const PixelWand *bordercolor,const size_t width,
+%        const size_t height)
 %
 %  A description of each parameter follows:
 %
@@ -1080,8 +1047,8 @@ WandExport MagickBooleanType MagickBlurImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickBorderImage(MagickWand *wand,
-  const PixelWand *bordercolor,const unsigned long width,
-  const unsigned long height)
+  const PixelWand *bordercolor,const size_t width,
+  const size_t height)
 {
   Image
     *border_image;
@@ -1238,8 +1205,8 @@ WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
 %  The format of the MagickChopImage method is:
 %
 %      MagickBooleanType MagickChopImage(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long x,
-%        const long y)
+%        const size_t width,const size_t height,const ssize_t x,
+%        const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -1256,8 +1223,8 @@ WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickChopImage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long x,
-  const long y)
+  const size_t width,const size_t height,const ssize_t x,
+  const ssize_t y)
 {
   Image
     *chop_image;
@@ -1652,6 +1619,58 @@ WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   M a g i c k C o l o r M a t r i x I m a g e                               %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickColorMatrixImage() apply color transformation to an image. The method
+%  permits saturation changes, hue rotation, luminance to alpha, and various
+%  other effects.  Although variable-sized transformation matrices can be used,
+%  typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA
+%  (or RGBA with offsets).  The matrix is similar to those used by Adobe Flash
+%  except offsets are in column 6 rather than 5 (in support of CMYKA images)
+%  and offsets are normalized (divide Flash offset by 255).
+%
+%  The format of the MagickColorMatrixImage method is:
+%
+%      MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
+%        const KernelInfo *color_matrix)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+%    o color_matrix:  the color matrix.
+%
+*/
+WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand,
+  const KernelInfo *color_matrix)
+{
+  Image
+    *color_image;
+
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  if (color_matrix == (const KernelInfo *) NULL)
+    return(MagickFalse);
+  if (wand->images == (Image *) NULL)
+    ThrowWandException(WandError,"ContainsNoImages",wand->name);
+  color_image=ColorMatrixImage(wand->images,color_matrix,wand->exception);
+  if (color_image == (Image *) NULL)
+    return(MagickFalse);
+  ReplaceImageInList(&wand->images,color_image);
+  return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   M a g i c k C o m b i n e I m a g e s                                     %
 %                                                                             %
 %                                                                             %
@@ -1911,10 +1930,10 @@ WandExport MagickWand *MagickCompareImages(MagickWand *wand,
 %
 %      MagickBooleanType MagickCompositeImage(MagickWand *wand,
 %        const MagickWand *composite_wand,const CompositeOperator compose,
-%        const long x,const long y)
+%        const ssize_t x,const ssize_t y)
 %      MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
 %        const ChannelType channel,const MagickWand *composite_wand,
-%        const CompositeOperator compose,const long x,const long y)
+%        const CompositeOperator compose,const ssize_t x,const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -1938,8 +1957,8 @@ WandExport MagickWand *MagickCompareImages(MagickWand *wand,
 */
 
 WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
-  const MagickWand *composite_wand,const CompositeOperator compose,const long x,
-  const long y)
+  const MagickWand *composite_wand,const CompositeOperator compose,const ssize_t x,
+  const ssize_t y)
 {
   MagickBooleanType
     status;
@@ -1951,7 +1970,7 @@ WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand,
 
 WandExport MagickBooleanType MagickCompositeImageChannel(MagickWand *wand,
   const ChannelType channel,const MagickWand *composite_wand,
-  const CompositeOperator compose,const long x,const long y)
+  const CompositeOperator compose,const ssize_t x,const ssize_t y)
 {
   MagickBooleanType
     status;
@@ -2098,9 +2117,9 @@ WandExport MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
 %  The format of the MagickConvolveImage method is:
 %
 %      MagickBooleanType MagickConvolveImage(MagickWand *wand,
-%        const unsigned long order,const double *kernel)
+%        const size_t order,const double *kernel)
 %      MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
-%        const ChannelType channel,const unsigned long order,
+%        const ChannelType channel,const size_t order,
 %        const double *kernel)
 %
 %  A description of each parameter follows:
@@ -2116,7 +2135,7 @@ WandExport MagickBooleanType MagickContrastStretchImageChannel(MagickWand *wand,
 */
 
 WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
-  const unsigned long order,const double *kernel)
+  const size_t order,const double *kernel)
 {
   MagickBooleanType
     status;
@@ -2126,7 +2145,7 @@ WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand,
 }
 
 WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
-  const ChannelType channel,const unsigned long order,const double *kernel)
+  const ChannelType channel,const size_t order,const double *kernel)
 {
   Image
     *convolve_image;
@@ -2163,8 +2182,7 @@ WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
 %  The format of the MagickCropImage method is:
 %
 %      MagickBooleanType MagickCropImage(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long x,
-%        const long y)
+%        const size_t width,const size_t height,const ssize_t x,const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -2180,8 +2198,7 @@ WandExport MagickBooleanType MagickConvolveImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long x,
-  const long y)
+  const size_t width,const size_t height,const ssize_t x,const ssize_t y)
 {
   Image
     *crop_image;
@@ -2224,7 +2241,7 @@ WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
 %  The format of the MagickCycleColormapImage method is:
 %
 %      MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
-%        const long displace)
+%        const ssize_t displace)
 %
 %  A description of each parameter follows:
 %
@@ -2234,7 +2251,7 @@ WandExport MagickBooleanType MagickCropImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
-  const long displace)
+  const ssize_t displace)
 {
   MagickBooleanType
     status;
@@ -2275,7 +2292,7 @@ WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
 %  The format of the MagickConstituteImage method is:
 %
 %      MagickBooleanType MagickConstituteImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows,const char *map,
+%        const size_t columns,const size_t rows,const char *map,
 %        const StorageType storage,void *pixels)
 %
 %  A description of each parameter follows:
@@ -2304,7 +2321,7 @@ WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows,const char *map,
+  const size_t columns,const size_t rows,const char *map,
   const StorageType storage,const void *pixels)
 {
   Image
@@ -2632,7 +2649,7 @@ WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
 %  The format of the MagickDistortImage method is:
 %
 %      MagickBooleanType MagickDistortImage(MagickWand *wand,
-%        const DistortImageMethod method,const unsigned long number_arguments,
+%        const DistortImageMethod method,const size_t number_arguments,
 %        const double *arguments,const MagickBooleanType bestfit)
 %
 %  A description of each parameter follows:
@@ -2668,7 +2685,7 @@ WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickDistortImage(MagickWand *wand,
-  const DistortImageMethod method,const unsigned long number_arguments,
+  const DistortImageMethod method,const size_t number_arguments,
   const double *arguments,const MagickBooleanType bestfit)
 {
   Image
@@ -2994,6 +3011,8 @@ WandExport MagickBooleanType MagickEqualizeImageChannel(MagickWand *wand,
 %
 %      MagickBooleanType MagickEvaluateImage(MagickWand *wand,
 %        const MagickEvaluateOperator operator,const double value)
+%      MagickBooleanType MagickEvaluateImages(MagickWand *wand,
+%        const MagickEvaluateOperator operator)
 %      MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
 %        const ChannelType channel,const MagickEvaluateOperator op,
 %        const double value)
@@ -3028,6 +3047,24 @@ WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand,
   return(status);
 }
 
+WandExport MagickWand *MagickEvaluateImages(MagickWand *wand,
+  const MagickEvaluateOperator op)
+{
+  Image
+    *evaluate_image;
+
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  if (wand->images == (Image *) NULL)
+    return((MagickWand *) NULL);
+  evaluate_image=EvaluateImages(wand->images,op,wand->exception);
+  if (evaluate_image == (Image *) NULL)
+    return((MagickWand *) NULL);
+  return(CloneMagickWandFromImages(wand,evaluate_image));
+}
+
 WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
   const ChannelType channel,const MagickEvaluateOperator op,const double value)
 {
@@ -3059,7 +3096,7 @@ WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
 %  MagickExportImagePixels() extracts pixel data from an image and returns it
 %  to you.  The method returns MagickTrue on success otherwise MagickFalse if
 %  an error is encountered.  The data is returned as char, short int, int,
-%  long, float, or double in the order specified by map.
+%  ssize_t, float, or double in the order specified by map.
 %
 %  Suppose you want to extract the first scanline of a 640x480 image as
 %  character data in red-green-blue order:
@@ -3069,8 +3106,8 @@ WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
 %  The format of the MagickExportImagePixels method is:
 %
 %      MagickBooleanType MagickExportImagePixels(MagickWand *wand,
-%        const long x,const long y,const unsigned long columns,
-%        const unsigned long rows,const char *map,const StorageType storage,
+%        const ssize_t x,const ssize_t y,const size_t columns,
+%        const size_t rows,const char *map,const StorageType storage,
 %        void *pixels)
 %
 %  A description of each parameter follows:
@@ -3097,8 +3134,8 @@ WandExport MagickBooleanType MagickEvaluateImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
-  const long x,const long y,const unsigned long columns,
-  const unsigned long rows,const char *map,const StorageType storage,
+  const ssize_t x,const ssize_t y,const size_t columns,
+  const size_t rows,const char *map,const StorageType storage,
   void *pixels)
 {
   MagickBooleanType
@@ -3135,8 +3172,8 @@ WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
 %  The format of the MagickExtentImage method is:
 %
 %      MagickBooleanType MagickExtentImage(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long x,
-%        const long y)
+%        const size_t width,const size_t height,const ssize_t x,
+%        const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -3152,8 +3189,8 @@ WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickExtentImage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long x,
-  const long y)
+  const size_t width,const size_t height,const ssize_t x,
+  const ssize_t y)
 {
   Image
     *extent_image;
@@ -3300,7 +3337,7 @@ WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
 %
 %      MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
 %        const ChannelType channel,const PixelWand *fill,const double fuzz,
-%        const PixelWand *bordercolor,const long x,const long y,
+%        const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
 %        const MagickBooleanType invert)
 %
 %  A description of each parameter follows:
@@ -3327,7 +3364,7 @@ WandExport MagickBooleanType MagickFlipImage(MagickWand *wand)
 */
 WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand,
   const ChannelType channel,const PixelWand *fill,const double fuzz,
-  const PixelWand *bordercolor,const long x,const long y,
+  const PixelWand *bordercolor,const ssize_t x,const ssize_t y,
   const MagickBooleanType invert)
 {
   DrawInfo
@@ -3468,9 +3505,9 @@ WandExport MagickBooleanType MagickForwardFourierTransformImage(
 %  The format of the MagickFrameImage method is:
 %
 %      MagickBooleanType MagickFrameImage(MagickWand *wand,
-%        const PixelWand *matte_color,const unsigned long width,
-%        const unsigned long height,const long inner_bevel,
-%        const long outer_bevel)
+%        const PixelWand *matte_color,const size_t width,
+%        const size_t height,const ssize_t inner_bevel,
+%        const ssize_t outer_bevel)
 %
 %  A description of each parameter follows:
 %
@@ -3488,8 +3525,8 @@ WandExport MagickBooleanType MagickForwardFourierTransformImage(
 %
 */
 WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
-  const PixelWand *matte_color,const unsigned long width,
-  const unsigned long height,const long inner_bevel,const long outer_bevel)
+  const PixelWand *matte_color,const size_t width,
+  const size_t height,const ssize_t inner_bevel,const ssize_t outer_bevel)
 {
   Image
     *frame_image;
@@ -3506,8 +3543,8 @@ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
   (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info));
   frame_info.width=wand->images->columns+2*width;
   frame_info.height=wand->images->rows+2*height;
-  frame_info.x=(long) width;
-  frame_info.y=(long) height;
+  frame_info.x=(ssize_t) width;
+  frame_info.y=(ssize_t) height;
   frame_info.inner_bevel=inner_bevel;
   frame_info.outer_bevel=outer_bevel;
   PixelGetQuantumColor(matte_color,&wand->images->matte_color);
@@ -3537,11 +3574,11 @@ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
 %  The format of the MagickFunctionImage method is:
 %
 %      MagickBooleanType MagickFunctionImage(MagickWand *wand,
-%        const MagickFunction function,const unsigned long number_arguments,
+%        const MagickFunction function,const size_t number_arguments,
 %        const double *arguments)
 %      MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
 %        const ChannelType channel,const MagickFunction function,
-%        const unsigned long number_arguments,const double *arguments)
+%        const size_t number_arguments,const double *arguments)
 %
 %  A description of each parameter follows:
 %
@@ -3558,7 +3595,7 @@ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand,
 */
 
 WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
-  const MagickFunction function,const unsigned long number_arguments,
+  const MagickFunction function,const size_t number_arguments,
   const double *arguments)
 {
   MagickBooleanType
@@ -3579,7 +3616,7 @@ WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand,
 
 WandExport MagickBooleanType MagickFunctionImageChannel(MagickWand *wand,
   const ChannelType channel,const MagickFunction function,
-  const unsigned long number_arguments,const double *arguments)
+  const size_t number_arguments,const double *arguments)
 {
   MagickBooleanType
     status;
@@ -3841,7 +3878,7 @@ WandExport MagickWand *MagickGetImage(MagickWand *wand)
 %
 %  The format of the MagickGetImageAlphaChannel method is:
 %
-%      unsigned long MagickGetImageAlphaChannel(MagickWand *wand)
+%      size_t MagickGetImageAlphaChannel(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
@@ -4129,7 +4166,7 @@ WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
 %
 %  The format of the MagickGetImageChannelDepth method is:
 %
-%      unsigned long MagickGetImageChannelDepth(MagickWand *wand,
+%      size_t MagickGetImageChannelDepth(MagickWand *wand,
 %        const ChannelType channel)
 %
 %  A description of each parameter follows:
@@ -4139,7 +4176,7 @@ WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand,
 %    o channel: the image channel(s).
 %
 */
-WandExport unsigned long MagickGetImageChannelDepth(MagickWand *wand,
+WandExport size_t MagickGetImageChannelDepth(MagickWand *wand,
   const ChannelType channel)
 {
   assert(wand != (MagickWand *) NULL);
@@ -4286,7 +4323,7 @@ WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
 %  The format of the MagickGetImageChannelFeatures method is:
 %
 %      ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
-%        const unsigned long distance)
+%        const size_t distance)
 %
 %  A description of each parameter follows:
 %
@@ -4296,7 +4333,7 @@ WandExport double *MagickGetImageChannelDistortions(MagickWand *wand,
 %
 */
 WandExport ChannelFeatures *MagickGetImageChannelFeatures(MagickWand *wand,
-  const unsigned long distance)
+  const size_t distance)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -4513,7 +4550,7 @@ WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
 %  The format of the MagickGetImageColormapColor method is:
 %
 %      MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
-%        const unsigned long index,PixelWand *color)
+%        const size_t index,PixelWand *color)
 %
 %  A description of each parameter follows:
 %
@@ -4525,7 +4562,7 @@ WandExport ChannelStatistics *MagickGetImageChannelStatistics(MagickWand *wand)
 %
 */
 WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
-  const unsigned long index,PixelWand *color)
+  const size_t index,PixelWand *color)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -4559,14 +4596,14 @@ WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand,
 %
 %  The format of the MagickGetImageColors method is:
 %
-%      unsigned long MagickGetImageColors(MagickWand *wand)
+%      size_t MagickGetImageColors(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageColors(MagickWand *wand)
+WandExport size_t MagickGetImageColors(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -4708,14 +4745,14 @@ WandExport CompressionType MagickGetImageCompression(MagickWand *wand)
 %
 %  The format of the MagickGetImageCompression method is:
 %
-%      unsigned long MagickGetImageCompression(MagickWand *wand)
+%      size_t MagickGetImageCompression(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageCompressionQuality(MagickWand *wand)
+WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -4745,14 +4782,14 @@ WandExport unsigned long MagickGetImageCompressionQuality(MagickWand *wand)
 %
 %  The format of the MagickGetImageDelay method is:
 %
-%      unsigned long MagickGetImageDelay(MagickWand *wand)
+%      size_t MagickGetImageDelay(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageDelay(MagickWand *wand)
+WandExport size_t MagickGetImageDelay(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -4778,14 +4815,14 @@ WandExport unsigned long MagickGetImageDelay(MagickWand *wand)
 %
 %  The format of the MagickGetImageDepth method is:
 %
-%      unsigned long MagickGetImageDepth(MagickWand *wand)
+%      size_t MagickGetImageDepth(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageDepth(MagickWand *wand)
+WandExport size_t MagickGetImageDepth(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -4936,7 +4973,7 @@ WandExport char *MagickGetImageFilename(MagickWand *wand)
 %
 %  The format of the MagickGetImageFormat method is:
 %
-%      const char MagickGetImageFormat(MagickWand *wand)
+%      const char *MagickGetImageFormat(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
@@ -5125,14 +5162,14 @@ WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand,
 %
 %  The format of the MagickGetImageHeight method is:
 %
-%      unsigned long MagickGetImageHeight(MagickWand *wand)
+%      size_t MagickGetImageHeight(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageHeight(MagickWand *wand)
+WandExport size_t MagickGetImageHeight(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -5160,7 +5197,7 @@ WandExport unsigned long MagickGetImageHeight(MagickWand *wand)
 %  The format of the MagickGetImageHistogram method is:
 %
 %      PixelWand **MagickGetImageHistogram(MagickWand *wand,
-%        unsigned long *number_colors)
+%        size_t *number_colors)
 %
 %  A description of each parameter follows:
 %
@@ -5171,7 +5208,7 @@ WandExport unsigned long MagickGetImageHeight(MagickWand *wand)
 %
 */
 WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
-  unsigned long *number_colors)
+  size_t *number_colors)
 {
   ColorPacket
     *histogram;
@@ -5179,7 +5216,7 @@ WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
   PixelWand
     **pixel_wands;
 
-  register long
+  register ssize_t
     i;
 
   assert(wand != (MagickWand *) NULL);
@@ -5196,11 +5233,11 @@ WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand,
   if (histogram == (ColorPacket *) NULL)
     return((PixelWand **) NULL);
   pixel_wands=NewPixelWands(*number_colors);
-  for (i=0; i < (long) *number_colors; i++)
+  for (i=0; i < (ssize_t) *number_colors; i++)
   {
     PixelSetQuantumColor(pixel_wands[i],&histogram[i].pixel);
     PixelSetIndex(pixel_wands[i],histogram[i].index);
-    PixelSetColorCount(pixel_wands[i],(unsigned long) histogram[i].count);
+    PixelSetColorCount(pixel_wands[i],(size_t) histogram[i].count);
   }
   histogram=(ColorPacket *) RelinquishMagickMemory(histogram);
   return(pixel_wands);
@@ -5297,14 +5334,14 @@ WandExport InterpolatePixelMethod MagickGetImageInterpolateMethod(
 %
 %  The format of the MagickGetImageIterations method is:
 %
-%      unsigned long MagickGetImageIterations(MagickWand *wand)
+%      size_t MagickGetImageIterations(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageIterations(MagickWand *wand)
+WandExport size_t MagickGetImageIterations(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -5444,7 +5481,7 @@ WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
 %  The format of the MagickGetImagePage method is:
 %
 %      MagickBooleanType MagickGetImagePage(MagickWand *wand,
-%        unsigned long *width,unsigned long *height,long *x,long *y)
+%        size_t *width,size_t *height,ssize_t *x,ssize_t *y)
 %
 %  A description of each parameter follows:
 %
@@ -5460,7 +5497,7 @@ WandExport OrientationType MagickGetImageOrientation(MagickWand *wand)
 %
 */
 WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
-  unsigned long *width,unsigned long *height,long *x,long *y)
+  size_t *width,size_t *height,ssize_t *x,ssize_t *y)
 {
   assert(wand != (const MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -5491,7 +5528,7 @@ WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
 %  The format of the MagickGetImagePixelColor method is:
 %
 %      MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
-%        const long x,const long y,PixelWand *color)
+%        const ssize_t x,const ssize_t y,PixelWand *color)
 %
 %  A description of each parameter follows:
 %
@@ -5503,7 +5540,7 @@ WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand,
-  const long x,const long y,PixelWand *color)
+  const ssize_t x,const ssize_t y,PixelWand *color)
 {
   IndexPacket
     *indexes;
@@ -5639,8 +5676,8 @@ WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
 %  The format of the MagickGetImageRegion method is:
 %
 %      MagickWand *MagickGetImageRegion(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long x,
-%        const long y)
+%        const size_t width,const size_t height,const ssize_t x,
+%        const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -5656,8 +5693,8 @@ WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand,
 %
 */
 WandExport MagickWand *MagickGetImageRegion(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long x,
-  const long y)
+  const size_t width,const size_t height,const ssize_t x,
+  const ssize_t y)
 {
   Image
     *region_image;
@@ -5774,14 +5811,14 @@ WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand,
 %
 %  The format of the MagickGetImageScene method is:
 %
-%      unsigned long MagickGetImageScene(MagickWand *wand)
+%      size_t MagickGetImageScene(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageScene(MagickWand *wand)
+WandExport size_t MagickGetImageScene(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -5858,14 +5895,14 @@ WandExport char *MagickGetImageSignature(MagickWand *wand)
 %
 %  The format of the MagickGetImageTicksPerSecond method is:
 %
-%      unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
+%      size_t MagickGetImageTicksPerSecond(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
+WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -5873,7 +5910,7 @@ WandExport unsigned long MagickGetImageTicksPerSecond(MagickWand *wand)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  return((unsigned long) wand->images->ticks_per_second);
+  return((size_t) wand->images->ticks_per_second);
 }
 \f
 /*
@@ -6052,14 +6089,14 @@ WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand,
 %
 %  The format of the MagickGetImageWidth method is:
 %
-%      unsigned long MagickGetImageWidth(MagickWand *wand)
+%      size_t MagickGetImageWidth(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetImageWidth(MagickWand *wand)
+WandExport size_t MagickGetImageWidth(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -6086,14 +6123,14 @@ WandExport unsigned long MagickGetImageWidth(MagickWand *wand)
 %
 %  The format of the MagickGetNumberImages method is:
 %
-%      unsigned long MagickGetNumberImages(MagickWand *wand)
+%      size_t MagickGetNumberImages(MagickWand *wand)
 %
 %  A description of each parameter follows:
 %
 %    o wand: the magick wand.
 %
 */
-WandExport unsigned long MagickGetNumberImages(MagickWand *wand)
+WandExport size_t MagickGetNumberImages(MagickWand *wand)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -6395,7 +6432,7 @@ WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
 %  MagickImportImagePixels() accepts pixel datand stores it in the image at the
 %  location you specify.  The method returns MagickFalse on success otherwise
 %  MagickTrue if an error is encountered.  The pixel data can be either char,
-%  short int, int, long, float, or double in the order specified by map.
+%  short int, int, ssize_t, float, or double in the order specified by map.
 %
 %  Suppose your want to upload the first scanline of a 640x480 image from
 %  character data in red-green-blue order:
@@ -6405,8 +6442,8 @@ WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
 %  The format of the MagickImportImagePixels method is:
 %
 %      MagickBooleanType MagickImportImagePixels(MagickWand *wand,
-%        const long x,const long y,const unsigned long columns,
-%        const unsigned long rows,const char *map,const StorageType storage,
+%        const ssize_t x,const ssize_t y,const size_t columns,
+%        const size_t rows,const char *map,const StorageType storage,
 %        const void *pixels)
 %
 %  A description of each parameter follows:
@@ -6433,8 +6470,8 @@ WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
-  const long x,const long y,const unsigned long columns,
-  const unsigned long rows,const char *map,const StorageType storage,
+  const ssize_t x,const ssize_t y,const size_t columns,
+  const size_t rows,const char *map,const StorageType storage,
   const void *pixels)
 {
   MagickBooleanType
@@ -6457,52 +6494,6 @@ WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k I n t e n s i t y P r o j e c t i o n I m a g e s             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  MagickIntensityProjectionImages() returns the maximum (or minimum) intensity
-%  projection of an image sequence.
-%
-%  The format of the MagickIntensityProjectionImages method is:
-%
-%      MagickWand *MagickIntensityProjectionImages(MagickWand *wand,
-%        const MagickBooleanType projection)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the magick wand.
-%
-%    o projection: compute the minimum intensity projection for a value
-%      other than 0, otherwise compute the maximum.
-%
-*/
-WandExport MagickWand *MagickIntensityProjectionImages(MagickWand *wand,
-  const MagickBooleanType projection)
-{
-  Image
-    *projection_image;
-
-  assert(wand != (MagickWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  if (wand->images == (Image *) NULL)
-    return((MagickWand *) NULL);
-  projection_image=IntensityProjectionImages(wand->images,projection,
-    wand->exception);
-  if (projection_image == (Image *) NULL)
-    return((MagickWand *) NULL);
-  return(CloneMagickWandFromImages(wand,projection_image));
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   M a g i c k I n v e r s e F o u r i e r T r a n s f o r m I m a g e       %
 %                                                                             %
 %                                                                             %
@@ -6734,7 +6725,7 @@ WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
 %  MagickLiquidRescaleImage() rescales image with seam carving.
 %
 %      MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows,
+%        const size_t columns,const size_t rows,
 %        const double delta_x,const double rigidity)
 %
 %  A description of each parameter follows:
@@ -6751,7 +6742,7 @@ WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows,const double delta_x,
+  const size_t columns,const size_t rows,const double delta_x,
   const double rigidity)
 {
   Image
@@ -7150,7 +7141,7 @@ WandExport MagickWand *MagickMontageImage(MagickWand *wand,
 %  The format of the MagickMorphImages method is:
 %
 %      MagickWand *MagickMorphImages(MagickWand *wand,
-%        const unsigned long number_frames)
+%        const size_t number_frames)
 %
 %  A description of each parameter follows:
 %
@@ -7160,7 +7151,7 @@ WandExport MagickWand *MagickMontageImage(MagickWand *wand,
 %
 */
 WandExport MagickWand *MagickMorphImages(MagickWand *wand,
-  const unsigned long number_frames)
+  const size_t number_frames)
 {
   Image
     *morph_image;
@@ -7194,9 +7185,9 @@ WandExport MagickWand *MagickMorphImages(MagickWand *wand,
 %  The format of the MagickMorphologyImage method is:
 %
 %      MagickBooleanType MagickMorphologyImage(MagickWand *wand,
-%        MorphologyMethod method,const long iterations,KernelInfo *kernel)
+%        MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
 %      MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
-%        ChannelType channel,MorphologyMethod method,const long iterations,
+%        ChannelType channel,MorphologyMethod method,const ssize_t iterations,
 %        KernelInfo *kernel)
 %
 %  A description of each parameter follows:
@@ -7216,7 +7207,7 @@ WandExport MagickWand *MagickMorphImages(MagickWand *wand,
 */
 
 WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
-  MorphologyMethod method,const long iterations,KernelInfo *kernel)
+  MorphologyMethod method,const ssize_t iterations,KernelInfo *kernel)
 {
   MagickBooleanType
     status;
@@ -7227,7 +7218,7 @@ WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand,
 }
 
 WandExport MagickBooleanType MagickMorphologyImageChannel(MagickWand *wand,
-  const ChannelType channel,MorphologyMethod method,const long iterations,
+  const ChannelType channel,MorphologyMethod method,const ssize_t iterations,
   KernelInfo *kernel)
 {
   Image
@@ -7400,7 +7391,7 @@ WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
 %  The format of the MagickNewImage method is:
 %
 %      MagickBooleanType MagickNewImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows,
+%        const size_t columns,const size_t rows,
 %        const PixelWand *background)
 %
 %  A description of each parameter follows:
@@ -7415,7 +7406,7 @@ WandExport MagickBooleanType MagickNegateImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickNewImage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,
+  const size_t width,const size_t height,
   const PixelWand *background)
 {
   Image
@@ -8016,7 +8007,7 @@ WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand,
-  const unsigned long levels,const MagickBooleanType dither)
+  const size_t levels,const MagickBooleanType dither)
 {
   MagickBooleanType
     status;
@@ -8143,8 +8134,8 @@ WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
 %  The format of the MagickQuantizeImage method is:
 %
 %      MagickBooleanType MagickQuantizeImage(MagickWand *wand,
-%        const unsigned long number_colors,const ColorspaceType colorspace,
-%        const unsigned long treedepth,const MagickBooleanType dither,
+%        const size_t number_colors,const ColorspaceType colorspace,
+%        const size_t treedepth,const MagickBooleanType dither,
 %        const MagickBooleanType measure_error)
 %
 %  A description of each parameter follows:
@@ -8176,8 +8167,8 @@ WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand)
 %
 */
 WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
-  const unsigned long number_colors,const ColorspaceType colorspace,
-  const unsigned long treedepth,const MagickBooleanType dither,
+  const size_t number_colors,const ColorspaceType colorspace,
+  const size_t treedepth,const MagickBooleanType dither,
   const MagickBooleanType measure_error)
 {
   MagickBooleanType
@@ -8224,8 +8215,8 @@ WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
 %  The format of the MagickQuantizeImages method is:
 %
 %      MagickBooleanType MagickQuantizeImages(MagickWand *wand,
-%        const unsigned long number_colors,const ColorspaceType colorspace,
-%        const unsigned long treedepth,const MagickBooleanType dither,
+%        const size_t number_colors,const ColorspaceType colorspace,
+%        const size_t treedepth,const MagickBooleanType dither,
 %        const MagickBooleanType measure_error)
 %
 %  A description of each parameter follows:
@@ -8257,8 +8248,8 @@ WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand,
-  const unsigned long number_colors,const ColorspaceType colorspace,
-  const unsigned long treedepth,const MagickBooleanType dither,
+  const size_t number_colors,const ColorspaceType colorspace,
+  const size_t treedepth,const MagickBooleanType dither,
   const MagickBooleanType measure_error)
 {
   MagickBooleanType
@@ -8364,8 +8355,8 @@ WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
 %  The format of the MagickRaiseImage method is:
 %
 %      MagickBooleanType MagickRaiseImage(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long x,
-%        const long y,const MagickBooleanType raise)
+%        const size_t width,const size_t height,const ssize_t x,
+%        const ssize_t y,const MagickBooleanType raise)
 %
 %  A description of each parameter follows:
 %
@@ -8378,8 +8369,8 @@ WandExport MagickBooleanType MagickRadialBlurImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long x,
-  const long y,const MagickBooleanType raise)
+  const size_t width,const size_t height,const ssize_t x,
+  const ssize_t y,const MagickBooleanType raise)
 {
   MagickBooleanType
     status;
@@ -8616,58 +8607,6 @@ WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k R e c o l o r I m a g e                                       %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  MagickRecolorImage() translate, scale, shear, or rotate image colors.
-%  Although you can use variable sized matrices, typically you use a 5 x 5 for
-%  an RGBA image and a 6x6 for CMYKA.  Populate the last row with normalized
-%  values to translate.
-%
-%  The format of the MagickRecolorImage method is:
-%
-%      MagickBooleanType MagickRecolorImage(MagickWand *wand,
-%        const unsigned long order,const double *color_matrix)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the magick wand.
-%
-%    o order: the number of columns and rows in the color matrix.
-%
-%    o color_matrix: An array of doubles representing the color matrix.
-%
-*/
-WandExport MagickBooleanType MagickRecolorImage(MagickWand *wand,
-  const unsigned long order,const double *color_matrix)
-{
-  Image
-    *transform_image;
-
-  assert(wand != (MagickWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  if (color_matrix == (const double *) NULL)
-    return(MagickFalse);
-  if (wand->images == (Image *) NULL)
-    ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  transform_image=RecolorImage(wand->images,order,color_matrix,
-    wand->exception);
-  if (transform_image == (Image *) NULL)
-    return(MagickFalse);
-  ReplaceImageInList(&wand->images,transform_image);
-  return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %     M a g i c k R e d u c e N o i s e I m a g e                             %
 %                                                                             %
 %                                                                             %
@@ -8934,7 +8873,7 @@ WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
 %  The format of the MagickResizeImage method is:
 %
 %      MagickBooleanType MagickResizeImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows,
+%        const size_t columns,const size_t rows,
 %        const FilterTypes filter,const double blur)
 %
 %  A description of each parameter follows:
@@ -8951,7 +8890,7 @@ WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows,const FilterTypes filter,
+  const size_t columns,const size_t rows,const FilterTypes filter,
   const double blur)
 {
   Image
@@ -8986,8 +8925,8 @@ WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
 %
 %  The format of the MagickRollImage method is:
 %
-%      MagickBooleanType MagickRollImage(MagickWand *wand,const long x,
-%        const unsigned long y)
+%      MagickBooleanType MagickRollImage(MagickWand *wand,const ssize_t x,
+%        const size_t y)
 %
 %  A description of each parameter follows:
 %
@@ -9000,7 +8939,7 @@ WandExport MagickBooleanType MagickResizeImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickRollImage(MagickWand *wand,
-  const long x,const long y)
+  const ssize_t x,const ssize_t y)
 {
   Image
     *roll_image;
@@ -9086,7 +9025,7 @@ WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
 %  The format of the MagickSampleImage method is:
 %
 %      MagickBooleanType MagickSampleImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows)
+%        const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -9099,7 +9038,7 @@ WandExport MagickBooleanType MagickRotateImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows)
+  const size_t columns,const size_t rows)
 {
   Image
     *sample_image;
@@ -9133,7 +9072,7 @@ WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
 %  The format of the MagickScaleImage method is:
 %
 %      MagickBooleanType MagickScaleImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows)
+%        const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -9146,7 +9085,7 @@ WandExport MagickBooleanType MagickSampleImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickScaleImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows)
+  const size_t columns,const size_t rows)
 {
   Image
     *scale_image;
@@ -9647,7 +9586,7 @@ WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
 %  The format of the MagickSetImageChannelDepth method is:
 %
 %      MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
-%        const ChannelType channel,const unsigned long depth)
+%        const ChannelType channel,const size_t depth)
 %
 %  A description of each parameter follows:
 %
@@ -9659,7 +9598,7 @@ WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageChannelDepth(MagickWand *wand,
-  const ChannelType channel,const unsigned long depth)
+  const ChannelType channel,const size_t depth)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -9716,6 +9655,51 @@ WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   M a g i c k S e t I m a g e C o l o r                                     %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickSetImageColor() set the entire wand canvas to the specified color.
+%
+%  The format of the MagickSetImageColor method is:
+%
+%      MagickBooleanType MagickSetImageColor(MagickWand *wand,
+%        const PixelWand *color)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+%    o background: the image color.
+%
+*/
+WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand,
+  const PixelWand *color)
+{
+  MagickBooleanType
+    status;
+
+  MagickPixelPacket
+    pixel;
+
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  PixelGetMagickColor(color,&pixel);
+  status=SetImageColor(wand->images,&pixel);
+  if (status == MagickFalse)
+    InheritException(wand->exception,&wand->images->exception);
+  return(status);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   M a g i c k S e t I m a g e C o l o r m a p C o l o r                     %
 %                                                                             %
 %                                                                             %
@@ -9728,7 +9712,7 @@ WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
 %  The format of the MagickSetImageColormapColor method is:
 %
 %      MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
-%        const unsigned long index,const PixelWand *color)
+%        const size_t index,const PixelWand *color)
 %
 %  A description of each parameter follows:
 %
@@ -9740,7 +9724,7 @@ WandExport MagickBooleanType MagickSetImageClipMask(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand,
-  const unsigned long index,const PixelWand *color)
+  const size_t index,const PixelWand *color)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -9890,7 +9874,7 @@ WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
 %  The format of the MagickSetImageCompressionQuality method is:
 %
 %      MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
-%        const unsigned long quality)
+%        const size_t quality)
 %
 %  A description of each parameter follows:
 %
@@ -9900,7 +9884,7 @@ WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
-  const unsigned long quality)
+  const size_t quality)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -9928,7 +9912,7 @@ WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
 %  The format of the MagickSetImageDelay method is:
 %
 %      MagickBooleanType MagickSetImageDelay(MagickWand *wand,
-%        const unsigned long delay)
+%        const size_t delay)
 %
 %  A description of each parameter follows:
 %
@@ -9938,7 +9922,7 @@ WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
-  const unsigned long delay)
+  const size_t delay)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -9966,7 +9950,7 @@ WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
 %  The format of the MagickSetImageDepth method is:
 %
 %      MagickBooleanType MagickSetImageDepth(MagickWand *wand,
-%        const unsigned long depth)
+%        const size_t depth)
 %
 %  A description of each parameter follows:
 %
@@ -9976,7 +9960,7 @@ WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand,
-  const unsigned long depth)
+  const size_t depth)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -10042,7 +10026,7 @@ WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
 %  The format of the MagickSetImageExtent method is:
 %
 %      MagickBooleanType MagickSetImageExtent(MagickWand *wand,
-%        const unsigned long columns,const unsigned rows)
+%        const size_t columns,const unsigned rows)
 %
 %  A description of each parameter follows:
 %
@@ -10054,7 +10038,7 @@ WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows)
+  const size_t columns,const size_t rows)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -10408,7 +10392,7 @@ WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
 %  The format of the MagickSetImageIterations method is:
 %
 %      MagickBooleanType MagickSetImageIterations(MagickWand *wand,
-%        const unsigned long iterations)
+%        const size_t iterations)
 %
 %  A description of each parameter follows:
 %
@@ -10418,7 +10402,7 @@ WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand,
-  const unsigned long iterations)
+  const size_t iterations)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -10608,8 +10592,8 @@ WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
 %  The format of the MagickSetImagePage method is:
 %
 %      MagickBooleanType MagickSetImagePage(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long x,
-%        const long y)
+%        const size_t width,const size_t height,const ssize_t x,
+%        const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -10625,8 +10609,8 @@ WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long x,
-  const long y)
+  const size_t width,const size_t height,const ssize_t x,
+  const ssize_t y)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -10836,7 +10820,7 @@ WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
 %  The format of the MagickSetImageScene method is:
 %
 %      MagickBooleanType MagickSetImageScene(MagickWand *wand,
-%        const unsigned long scene)
+%        const size_t scene)
 %
 %  A description of each parameter follows:
 %
@@ -10846,7 +10830,7 @@ WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
-  const unsigned long scene)
+  const size_t scene)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -10874,7 +10858,7 @@ WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
 %  The format of the MagickSetImageTicksPerSecond method is:
 %
 %      MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
-%        const long ticks_per-second)
+%        const ssize_t ticks_per-second)
 %
 %  A description of each parameter follows:
 %
@@ -10884,7 +10868,7 @@ WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand,
-  const long ticks_per_second)
+  const ssize_t ticks_per_second)
 {
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
@@ -11121,7 +11105,7 @@ WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
 %  The format of the MagickShadowImage method is:
 %
 %      MagickBooleanType MagickShadowImage(MagickWand *wand,
-%        const double opacity,const double sigma,const long x,const long y)
+%        const double opacity,const double sigma,const ssize_t x,const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -11137,7 +11121,7 @@ WandExport MagickBooleanType MagickShadeImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickShadowImage(MagickWand *wand,
-  const double opacity,const double sigma,const long x,const long y)
+  const double opacity,const double sigma,const ssize_t x,const ssize_t y)
 {
   Image
     *shadow_image;
@@ -11239,7 +11223,7 @@ WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
 %  The format of the MagickShaveImage method is:
 %
 %      MagickBooleanType MagickShaveImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows)
+%        const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -11252,7 +11236,7 @@ WandExport MagickBooleanType MagickSharpenImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickShaveImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows)
+  const size_t columns,const size_t rows)
 {
   Image
     *shave_image;
@@ -11368,9 +11352,10 @@ WandExport MagickBooleanType MagickShearImage(MagickWand *wand,
 %
 %    o sharpen: Increase or decrease image contrast.
 %
-%    o alpha: control the "shoulder" of the contast curve.
+%    o alpha: strength of the contrast, the larger the number the more
+%      'threshold-like' it becomes.
 %
-%    o beta: control the "toe" of the contast curve.
+%    o beta: midpoint of the function as a color value 0 to QuantumRange.
 %
 */
 
@@ -11577,7 +11562,7 @@ WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
 %
 %      MagickBooleanType MagickSparseColorImage(MagickWand *wand,
 %        const ChannelType channel,const SparseColorMethod method,
-%        const unsigned long number_arguments,const double *arguments)
+%        const size_t number_arguments,const double *arguments)
 %
 %  A description of each parameter follows:
 %
@@ -11611,7 +11596,7 @@ WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand,
 */
 WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
   const ChannelType channel,const SparseColorMethod method,
-  const unsigned long number_arguments,const double *arguments)
+  const size_t number_arguments,const double *arguments)
 {
   Image
     *sparse_image;
@@ -11646,8 +11631,8 @@ WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
 %  The format of the MagickSpliceImage method is:
 %
 %      MagickBooleanType MagickSpliceImage(MagickWand *wand,
-%        const unsigned long width,const unsigned long height,const long x,
-%        const long y)
+%        const size_t width,const size_t height,const ssize_t x,
+%        const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -11663,8 +11648,8 @@ WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand,
-  const unsigned long width,const unsigned long height,const long x,
-  const long y)
+  const size_t width,const size_t height,const ssize_t x,
+  const ssize_t y)
 {
   Image
     *splice_image;
@@ -11752,7 +11737,7 @@ WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
 %  The format of the MagickSteganoImage method is:
 %
 %      MagickWand *MagickSteganoImage(MagickWand *wand,
-%        const MagickWand *watermark_wand,const long offset)
+%        const MagickWand *watermark_wand,const ssize_t offset)
 %
 %  A description of each parameter follows:
 %
@@ -11764,7 +11749,7 @@ WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
 %
 */
 WandExport MagickWand *MagickSteganoImage(MagickWand *wand,
-  const MagickWand *watermark_wand,const long offset)
+  const MagickWand *watermark_wand,const ssize_t offset)
 {
   Image
     *stegano_image;
@@ -12057,7 +12042,7 @@ WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
 %  The format of the MagickThumbnailImage method is:
 %
 %      MagickBooleanType MagickThumbnailImage(MagickWand *wand,
-%        const unsigned long columns,const unsigned long rows)
+%        const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -12069,7 +12054,7 @@ WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand,
-  const unsigned long columns,const unsigned long rows)
+  const size_t columns,const size_t rows)
 {
   Image
     *thumbnail_image;
@@ -12577,8 +12562,8 @@ WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
 %  The format of the MagickVignetteImage method is:
 %
 %      MagickBooleanType MagickVignetteImage(MagickWand *wand,
-%        const double black_point,const double white_point,const long x,
-%        const long y)
+%        const double black_point,const double white_point,const ssize_t x,
+%        const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -12592,7 +12577,7 @@ WandExport MagickBooleanType MagickUnsharpMaskImageChannel(MagickWand *wand,
 %
 */
 WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand,
-  const double black_point,const double white_point,const long x,const long y)
+  const double black_point,const double white_point,const ssize_t x,const ssize_t y)
 {
   Image
     *vignette_image;