]> granicus.if.org Git - imagemagick/blobdiff - magick/deprecate.c
(no commit message)
[imagemagick] / magick / deprecate.c
index 02abbf8b1b49fbbd7009b4df3a491071d7cd9673..ce94831c5822181d6713b5cd90cfb9a5792e5716 100644 (file)
@@ -17,7 +17,7 @@
 %                                October 2002                                 %
 %                                                                             %
 %                                                                             %
-%  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  %
@@ -62,6 +62,7 @@
 #include "magick/enhance.h"
 #include "magick/exception.h"
 #include "magick/exception-private.h"
+#include "magick/fx.h"
 #include "magick/geometry.h"
 #include "magick/identify.h"
 #include "magick/image.h"
@@ -72,6 +73,7 @@
 #include "magick/magick.h"
 #include "magick/monitor.h"
 #include "magick/monitor-private.h"
+#include "magick/morphology.h"
 #include "magick/paint.h"
 #include "magick/pixel.h"
 #include "magick/pixel-private.h"
@@ -81,6 +83,7 @@
 #include "magick/semaphore.h"
 #include "magick/segment.h"
 #include "magick/splay-tree.h"
+#include "magick/statistic.h"
 #include "magick/string_.h"
 #include "magick/threshold.h"
 #include "magick/transform.h"
@@ -107,6 +110,10 @@ static MonitorHandler
 %  AcquireCacheViewIndexes() returns the indexes associated with the specified
 %  view.
 %
+%  Deprecated, replace with:
+%
+%    GetCacheViewVirtualIndexQueue(cache_view);
+%
 %  The format of the AcquireCacheViewIndexes method is:
 %
 %      const IndexPacket *AcquireCacheViewIndexes(const CacheView *cache_view)
@@ -137,11 +144,15 @@ MagickExport const IndexPacket *AcquireCacheViewIndexes(
 %  as defined by the geometry parameters.   A pointer to the pixels is returned
 %  if the pixels are transferred, otherwise a NULL is returned.
 %
+%  Deprecated, replace with:
+%
+%    GetCacheViewVirtualPixels(cache_view,x,y,columns,rows,exception);
+%
 %  The format of the AcquireCacheViewPixels method is:
 %
 %      const PixelPacket *AcquireCacheViewPixels(const CacheView *cache_view,
-%        const long x,const long y,const unsigned long columns,
-%        const unsigned long rows,ExceptionInfo *exception)
+%        const ssize_t x,const ssize_t y,const size_t columns,
+%        const size_t rows,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -154,8 +165,8 @@ MagickExport const IndexPacket *AcquireCacheViewIndexes(
 %
 */
 MagickExport const PixelPacket *AcquireCacheViewPixels(
-  const CacheView *cache_view,const long x,const long y,
-  const unsigned long columns,const unsigned long rows,ExceptionInfo *exception)
+  const CacheView *cache_view,const ssize_t x,const ssize_t y,
+  const size_t columns,const size_t rows,ExceptionInfo *exception)
 {
   return(GetCacheViewVirtualPixels(cache_view,x,y,columns,rows,exception));
 }
@@ -165,9 +176,8 @@ MagickExport const PixelPacket *AcquireCacheViewPixels(
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   A c q u i r e I m a g e P i x e l s                                        %
-%                                                                             %
-%                                                                             %
+%   A c q u i r e I m a g e P i x e l s                                       %
+%                                                                             % %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
@@ -182,9 +192,9 @@ MagickExport const PixelPacket *AcquireCacheViewPixels(
 %
 %  Pixels accessed via the returned pointer represent a simple array of type
 %  PixelPacket.  If the image type is CMYK or the storage class is PseudoClass,
-%  call GetAuthenticIndexQueue() after invoking GetAuthenticPixels() to access the
-%  black color component or to obtain the colormap indexes (of type IndexPacket)
-%  corresponding to the region.
+%  call GetAuthenticIndexQueue() after invoking GetAuthenticPixels() to access
+%  the black color component or to obtain the colormap indexes (of type
+%  IndexPacket) corresponding to the region.
 %
 %  If you plan to modify the pixels, use GetAuthenticPixels() instead.
 %
@@ -192,10 +202,14 @@ MagickExport const PixelPacket *AcquireCacheViewPixels(
 %  thread-safe.  In a threaded environment, use GetCacheViewVirtualPixels() or
 %  GetCacheViewAuthenticPixels() instead.
 %
+%  Deprecated, replace with:
+%
+%    GetVirtualPixels(image,x,y,columns,rows,exception);
+%
 %  The format of the AcquireImagePixels() method is:
 %
-%      const PixelPacket *AcquireImagePixels(const Image *image,const long x,
-%        const long y,const unsigned long columns,const unsigned long rows,
+%      const PixelPacket *AcquireImagePixels(const Image *image,const ssize_t x,
+%        const ssize_t y,const size_t columns,const size_t rows,
 %        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -209,8 +223,8 @@ MagickExport const PixelPacket *AcquireCacheViewPixels(
 %
 */
 MagickExport const PixelPacket *AcquireImagePixels(const Image *image,
-  const long x,const long y,const unsigned long columns,
-  const unsigned long rows,ExceptionInfo *exception)
+  const ssize_t x,const ssize_t y,const size_t columns,
+  const size_t rows,ExceptionInfo *exception)
 {
   return(GetVirtualPixels(image,x,y,columns,rows,exception));
 }
@@ -227,8 +241,13 @@ MagickExport const PixelPacket *AcquireImagePixels(const Image *image,
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %  AcquireIndexes() returns the black channel or the colormap indexes
-%  associated with the last call to QueueAuthenticPixels() or GetVirtualPixels().
-%  NULL is returned if the black channel or colormap indexes are not available.
+%  associated with the last call to QueueAuthenticPixels() or
+%  GetVirtualPixels().  NULL is returned if the black channel or colormap
+%  indexes are not available.
+%
+%  Deprecated, replace with:
+%
+%    GetVirtualIndexQueue(image);
 %
 %  The format of the AcquireIndexes() method is:
 %
@@ -296,10 +315,14 @@ MagickExport void *AcquireMemory(const size_t size)
 %  location.  The image background color is returned if an error occurs.  If
 %  you plan to modify the pixel, use GetOneCacheViewAuthenticPixel() instead.
 %
+%  Deprecated, replace with:
+%
+%    GetOneCacheViewVirtualPixel(cache_view,x,y,pixel,exception);
+%
 %  The format of the AcquireOneCacheViewPixel method is:
 %
 %      MagickBooleanType AcquireOneCacheViewPixel(const CacheView *cache_view,
-%        const long x,const long y,PixelPacket *pixel,ExceptionInfo *exception)
+%        const ssize_t x,const ssize_t y,PixelPacket *pixel,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -313,7 +336,7 @@ MagickExport void *AcquireMemory(const size_t size)
 %
 */
 MagickExport MagickBooleanType AcquireOneCacheViewPixel(
-  const CacheView *cache_view,const long x,const long y,PixelPacket *pixel,
+  const CacheView *cache_view,const ssize_t x,const ssize_t y,PixelPacket *pixel,
   ExceptionInfo *exception)
 {
   return(GetOneCacheViewVirtualPixel(cache_view,x,y,pixel,exception));
@@ -334,12 +357,17 @@ MagickExport MagickBooleanType AcquireOneCacheViewPixel(
 %  (x,y) location.  The image background color is returned if an error occurs.
 %  If you plan to modify the pixel, use GetOneCacheViewAuthenticPixel() instead.
 %
+%  Deprecated, replace with:
+%
+%    GetOneCacheViewVirtualMethodPixel(cache_view,virtual_pixel_method,
+%      x,y,pixel,exception);
+%
 %  The format of the AcquireOneCacheViewPixel method is:
 %
 %      MagickBooleanType AcquireOneCacheViewVirtualPixel(
 %        const CacheView *cache_view,
-%        const VirtualPixelMethod virtual_pixel_method,const long x,
-%        const long y,PixelPacket *pixel,ExceptionInfo *exception)
+%        const VirtualPixelMethod virtual_pixel_method,const ssize_t x,
+%        const ssize_t y,PixelPacket *pixel,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -356,7 +384,7 @@ MagickExport MagickBooleanType AcquireOneCacheViewPixel(
 */
 MagickExport MagickBooleanType AcquireOneCacheViewVirtualPixel(
   const CacheView *cache_view,const VirtualPixelMethod virtual_pixel_method,
-  const long x,const long y,PixelPacket *pixel,ExceptionInfo *exception)
+  const ssize_t x,const ssize_t y,PixelPacket *pixel,ExceptionInfo *exception)
 {
   MagickBooleanType
     status;
@@ -381,10 +409,15 @@ MagickExport MagickBooleanType AcquireOneCacheViewVirtualPixel(
 %  location.  The image background color is returned if an error occurs.  If
 %  you plan to modify the pixel, use GetOnePixel() instead.
 %
+%  Deprecated, replace with:
+%
+%    MagickPixelPacket pixel;
+%    GetOneVirtualMagickPixel(image,x,y,&pixel,exception);
+%
 %  The format of the AcquireOneMagickPixel() method is:
 %
-%      MagickPixelPacket AcquireOneMagickPixel(const Image image,const long x,
-%        const long y,ExceptionInfo exception)
+%      MagickPixelPacket AcquireOneMagickPixel(const Image image,const ssize_t x,
+%        const ssize_t y,ExceptionInfo exception)
 %
 %  A description of each parameter follows:
 %
@@ -396,7 +429,7 @@ MagickExport MagickBooleanType AcquireOneCacheViewVirtualPixel(
 %
 */
 MagickExport MagickPixelPacket AcquireOneMagickPixel(const Image *image,
-  const long x,const long y,ExceptionInfo *exception)
+  const ssize_t x,const ssize_t y,ExceptionInfo *exception)
 {
   MagickPixelPacket
     pixel;
@@ -420,10 +453,15 @@ MagickExport MagickPixelPacket AcquireOneMagickPixel(const Image *image,
 %  The image background color is returned if an error occurs.  If you plan to
 %  modify the pixel, use GetOnePixel() instead.
 %
+%  Deprecated, replace with:
+%
+%    PixelPacket pixel;
+%    GetOneVirtualPixel(image,x,y,&pixel,exception);
+%
 %  The format of the AcquireOnePixel() method is:
 %
-%      PixelPacket AcquireOnePixel(const Image image,const long x,
-%        const long y,ExceptionInfo exception)
+%      PixelPacket AcquireOnePixel(const Image image,const ssize_t x,
+%        const ssize_t y,ExceptionInfo exception)
 %
 %  A description of each parameter follows:
 %
@@ -434,8 +472,8 @@ MagickExport MagickPixelPacket AcquireOneMagickPixel(const Image *image,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport PixelPacket AcquireOnePixel(const Image *image,const long x,
-  const long y,ExceptionInfo *exception)
+MagickExport PixelPacket AcquireOnePixel(const Image *image,const ssize_t x,
+  const ssize_t y,ExceptionInfo *exception)
 {
   PixelPacket
     pixel;
@@ -460,11 +498,16 @@ MagickExport PixelPacket AcquireOnePixel(const Image *image,const long x,
 %  is returned if an error occurs.  If you plan to modify the pixel, use
 %  GetOnePixel() instead.
 %
+%  Deprecated, replace with:
+%
+%    PixelPacket pixel;
+%    GetOneVirtualMethodPixel(image,virtual_pixel_method,x,y,&pixel,exception);
+%
 %  The format of the AcquireOneVirtualPixel() method is:
 %
 %      PixelPacket AcquireOneVirtualPixel(const Image image,
-%        const VirtualPixelMethod virtual_pixel_method,const long x,
-%        const long y,ExceptionInfo exception)
+%        const VirtualPixelMethod virtual_pixel_method,const ssize_t x,
+%        const ssize_t y,ExceptionInfo exception)
 %
 %  A description of each parameter follows:
 %
@@ -478,7 +521,7 @@ MagickExport PixelPacket AcquireOnePixel(const Image *image,const long x,
 %
 */
 MagickExport PixelPacket AcquireOneVirtualPixel(const Image *image,
-  const VirtualPixelMethod virtual_pixel_method,const long x,const long y,
+  const VirtualPixelMethod virtual_pixel_method,const ssize_t x,const ssize_t y,
   ExceptionInfo *exception)
 {
   PixelPacket
@@ -503,6 +546,10 @@ MagickExport PixelPacket AcquireOneVirtualPixel(const Image *image,
 %  AcquirePixels() returns the pixels associated with the last call to
 %  QueueAuthenticPixels() or GetVirtualPixels().
 %
+%  Deprecated, replace with:
+%
+%    GetVirtualPixelQueue(image);
+%
 %  The format of the AcquirePixels() method is:
 %
 %      const PixelPacket *AcquirePixels(const Image image)
@@ -531,6 +578,10 @@ MagickExport const PixelPacket *AcquirePixels(const Image *image)
 %  AffinityImage() replaces the colors of an image with the closest color from
 %  a reference image.
 %
+%  Deprecated, replace with:
+%
+%    RemapImage(quantize_info,image,affinity_image);
+%
 %  The format of the AffinityImage method is:
 %
 %      MagickBooleanType AffinityImage(const QuantizeInfo *quantize_info,
@@ -565,6 +616,10 @@ MagickExport MagickBooleanType AffinityImage(const QuantizeInfo *quantize_info,
 %  AffinityImages() replaces the colors of a sequence of images with the
 %  closest color from a reference image.
 %
+%  Deprecated, replace with:
+%
+%    RemapImages(quantize_info,images,affinity_image);
+%
 %  The format of the AffinityImage method is:
 %
 %      MagickBooleanType AffinityImages(const QuantizeInfo *quantize_info,
@@ -599,6 +654,10 @@ MagickExport MagickBooleanType AffinityImages(const QuantizeInfo *quantize_info,
 %  AllocateImage() returns a pointer to an image structure initialized to
 %  default values.
 %
+%  Deprecated, replace with:
+%
+%    AcquireImage(image_info);
+%
 %  The format of the AllocateImage method is:
 %
 %      Image *AllocateImage(const ImageInfo *image_info)
@@ -631,10 +690,14 @@ MagickExport Image *AllocateImage(const ImageInfo *image_info)
 %  it is replaced.  AllocateImageColormap() returns MagickTrue if successful,
 %  otherwise MagickFalse if there is not enough memory.
 %
+%  Deprecated, replace with:
+%
+%    AcquireImageColormap(image,colors);
+%
 %  The format of the AllocateImageColormap method is:
 %
 %      MagickBooleanType AllocateImageColormap(Image *image,
-%        const unsigned long colors)
+%        const size_t colors)
 %
 %  A description of each parameter follows:
 %
@@ -644,7 +707,7 @@ MagickExport Image *AllocateImage(const ImageInfo *image_info)
 %
 */
 MagickExport MagickBooleanType AllocateImageColormap(Image *image,
-  const unsigned long colors)
+  const size_t colors)
 {
   return(AcquireImageColormap(image,colors));
 }
@@ -664,6 +727,10 @@ MagickExport MagickBooleanType AllocateImageColormap(Image *image,
 %  default values.  The next member of image points to the newly allocated
 %  image.  If there is a memory shortage, next is assigned NULL.
 %
+%  Deprecated, replace with:
+%
+%    AcquireNextImage(image_info,image);
+%
 %  The format of the AllocateNextImage method is:
 %
 %      void AllocateNextImage(const ImageInfo *image_info,Image *image)
@@ -687,7 +754,7 @@ MagickExport void AllocateNextImage(const ImageInfo *image_info,Image *image)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   A c q u i r e S t r i n g                                                 %
+%   A l l o c a t e S t r i n g                                               %
 %                                                                             %
 %                                                                             %
 %                                                                             %
@@ -730,6 +797,43 @@ MagickExport char *AllocateString(const char *source)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%     A v e r a g e I m a g e s                                               %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  AverageImages() takes a set of images and averages them together.  Each
+%  image in the set must have the same width and height.  AverageImages()
+%  returns a single image with each corresponding pixel component of each
+%  image averaged.   On failure, a NULL image is returned and exception
+%  describes the reason for the failure.
+%
+%  Deprecated, replace with:
+%
+%    EvaluateImages(images,MeanEvaluateOperator,exception);
+%
+%  The format of the AverageImages method is:
+%
+%      Image *AverageImages(Image *images,ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image sequence.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *AverageImages(const Image *images,ExceptionInfo *exception)
+{
+  return(EvaluateImages(images,MeanEvaluateOperator,exception));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %     C h a n n e l I m a g e                                                 %
 %                                                                             %
 %                                                                             %
@@ -739,6 +843,10 @@ MagickExport char *AllocateString(const char *source)
 %  Extract a channel from the image.  A channel is a particular color component
 %  of each pixel in the image.
 %
+%  Deprecated, replace with:
+%
+%    SeparateImageChannel(image,channel);
+%
 %  The format of the ChannelImage method is:
 %
 %      unsigned int ChannelImage(Image *image,const ChannelType channel)
@@ -830,6 +938,10 @@ MagickExport unsigned int ChannelThresholdImage(Image *image,const char *level)
 %  ClipPathImage() sets the image clip mask based any clipping path information
 %  if it exists.
 %
+%  Deprecated, replace with:
+%
+%    ClipImagePath(image,pathname,inside);
+%
 %  The format of the ClipImage method is:
 %
 %      MagickBooleanType ClipPathImage(Image *image,const char *pathname,
@@ -865,6 +977,10 @@ MagickExport MagickBooleanType ClipPathImage(Image *image,const char *pathname,
 %
 %  CloneImageAttributes() clones one or more image attributes.
 %
+%  Deprecated, replace with:
+%
+%    CloneImageProperties(image,clone_image);
+%
 %  The format of the CloneImageAttributes method is:
 %
 %      MagickBooleanType CloneImageAttributes(Image *image,
@@ -921,7 +1037,7 @@ MagickExport void *CloneMemory(void *destination,const void *source,
   register unsigned char
     *q;
 
-  register long
+  register ssize_t
     i;
 
   assert(destination != (void *) NULL);
@@ -936,7 +1052,7 @@ MagickExport void *CloneMemory(void *destination,const void *source,
   */
   p+=size;
   q+=size;
-  for (i=(long) (size-1); i >= 0; i--)
+  for (i=(ssize_t) (size-1); i >= 0; i--)
     *--q=(*--p);
   return(destination);
 }
@@ -955,6 +1071,10 @@ MagickExport void *CloneMemory(void *destination,const void *source,
 %  CloseCacheView() closes the specified view returned by a previous call to
 %  OpenCacheView().
 %
+%  Deprecated, replace with:
+%
+%    DestroyCacheView(view_info);
+%
 %  The format of the CloseCacheView method is:
 %
 %      CacheView *CloseCacheView(CacheView *view_info)
@@ -996,7 +1116,7 @@ MagickExport CacheView *CloseCacheView(CacheView *view_info)
 %
 %      MagickBooleanType ColorFloodfillImage(Image *image,
 %        const DrawInfo *draw_info,const PixelPacket target,
-%        const long x_offset,const long y_offset,const PaintMethod method)
+%        const ssize_t x_offset,const ssize_t y_offset,const PaintMethod method)
 %
 %  A description of each parameter follows:
 %
@@ -1019,7 +1139,7 @@ MagickExport CacheView *CloseCacheView(CacheView *view_info)
     ThrowBinaryException(DrawError,"SegmentStackOverflow",image->filename) \
   else \
     { \
-      if ((((up)+(delta)) >= 0) && (((up)+(delta)) < (long) image->rows)) \
+      if ((((up)+(delta)) >= 0) && (((up)+(delta)) < (ssize_t) image->rows)) \
         { \
           s->x1=(double) (left); \
           s->y1=(double) (up); \
@@ -1031,20 +1151,12 @@ MagickExport CacheView *CloseCacheView(CacheView *view_info)
 }
 
 MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
-  const DrawInfo *draw_info,const PixelPacket target,const long x_offset,
-  const long y_offset,const PaintMethod method)
+  const DrawInfo *draw_info,const PixelPacket target,const ssize_t x_offset,
+  const ssize_t y_offset,const PaintMethod method)
 {
   Image
     *floodplane_image;
 
-  long
-    offset,
-    start,
-    x,
-    x1,
-    x2,
-    y;
-
   MagickBooleanType
     skip;
 
@@ -1057,6 +1169,14 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
   SegmentInfo
     *segment_stack;
 
+  ssize_t
+    offset,
+    start,
+    x,
+    x1,
+    x2,
+    y;
+
   /*
     Check boundary conditions.
   */
@@ -1066,9 +1186,9 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   assert(draw_info != (DrawInfo *) NULL);
   assert(draw_info->signature == MagickSignature);
-  if ((x_offset < 0) || (x_offset >= (long) image->columns))
+  if ((x_offset < 0) || (x_offset >= (ssize_t) image->columns))
     return(MagickFalse);
-  if ((y_offset < 0) || (y_offset >= (long) image->rows))
+  if ((y_offset < 0) || (y_offset >= (ssize_t) image->rows))
     return(MagickFalse);
   if (SetImageStorageClass(image,DirectClass) == MagickFalse)
     return(MagickFalse);
@@ -1104,7 +1224,7 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
     register const PixelPacket
       *restrict p;
 
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -1114,15 +1234,15 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
       Pop segment off stack.
     */
     s--;
-    x1=(long) s->x1;
-    x2=(long) s->x2;
-    offset=(long) s->y2;
-    y=(long) s->y1+offset;
+    x1=(ssize_t) s->x1;
+    x2=(ssize_t) s->x2;
+    offset=(ssize_t) s->y2;
+    y=(ssize_t) s->y1+offset;
     /*
       Recolor neighboring pixels.
     */
-    p=GetVirtualPixels(image,0,y,(unsigned long) (x1+1),1,&image->exception);
-    q=GetAuthenticPixels(floodplane_image,0,y,(unsigned long) (x1+1),1,
+    p=GetVirtualPixels(image,0,y,(size_t) (x1+1),1,&image->exception);
+    q=GetAuthenticPixels(floodplane_image,0,y,(size_t) (x1+1),1,
       &image->exception);
     if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
       break;
@@ -1158,7 +1278,7 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
     {
       if (skip == MagickFalse)
         {
-          if (x < (long) image->columns)
+          if (x < (ssize_t) image->columns)
             {
               p=GetVirtualPixels(image,x,y,image->columns-x,1,
                 &image->exception);
@@ -1167,7 +1287,7 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
               if ((p == (const PixelPacket *) NULL) ||
                   (q == (PixelPacket *) NULL))
                 break;
-              for ( ; x < (long) image->columns; x++)
+              for ( ; x < (ssize_t) image->columns; x++)
               {
                 if (q->opacity == (Quantum) TransparentOpacity)
                   break;
@@ -1194,9 +1314,9 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
       x++;
       if (x <= x2)
         {
-          p=GetVirtualPixels(image,x,y,(unsigned long) (x2-x+1),1,
+          p=GetVirtualPixels(image,x,y,(size_t) (x2-x+1),1,
             &image->exception);
-          q=GetAuthenticPixels(floodplane_image,x,y,(unsigned long) (x2-x+1),1,
+          q=GetAuthenticPixels(floodplane_image,x,y,(size_t) (x2-x+1),1,
             &image->exception);
           if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
             break;
@@ -1219,12 +1339,12 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
       start=x;
     } while (x <= x2);
   }
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < (ssize_t) image->rows; y++)
   {
     register const PixelPacket
       *restrict p;
 
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -1238,9 +1358,9 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
     q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
     if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
       break;
-    for (x=0; x < (long) image->columns; x++)
+    for (x=0; x < (ssize_t) image->columns; x++)
     {
-      if (p->opacity != OpaqueOpacity)
+      if (GetOpacityPixelComponent(p) != OpaqueOpacity)
         {
           (void) GetFillColor(draw_info,x,y,&fill_color);
           MagickCompositeOver(&fill_color,(MagickRealType) fill_color.opacity,q,
@@ -1254,7 +1374,7 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
   }
   segment_stack=(SegmentInfo *) RelinquishMagickMemory(segment_stack);
   floodplane_image=DestroyImage(floodplane_image);
-  return(y == (long) image->rows ? MagickTrue : MagickFalse);
+  return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -1270,6 +1390,10 @@ MagickExport MagickBooleanType ColorFloodfillImage(Image *image,
 %
 %  DeleteImageAttribute() deletes an attribute from the image.
 %
+%  Deprecated, replace with:
+%
+%    DeleteImageProperty(image,key);
+%
 %  The format of the DeleteImageAttribute method is:
 %
 %      MagickBooleanType DeleteImageAttribute(Image *image,const char *key)
@@ -1302,7 +1426,7 @@ MagickExport MagickBooleanType DeleteImageAttribute(Image *image,
 %
 %  The format of the DeleteImageList method is:
 %
-%      unsigned int DeleteImageList(Image *images,const long offset)
+%      unsigned int DeleteImageList(Image *images,const ssize_t offset)
 %
 %  A description of each parameter follows:
 %
@@ -1311,9 +1435,9 @@ MagickExport MagickBooleanType DeleteImageAttribute(Image *image,
 %    o offset: the position within the list.
 %
 */
-MagickExport unsigned int DeleteImageList(Image *images,const long offset)
+MagickExport unsigned int DeleteImageList(Image *images,const ssize_t offset)
 {
-  register long
+  register ssize_t
     i;
 
   if (images->debug != MagickFalse)
@@ -1345,21 +1469,27 @@ MagickExport unsigned int DeleteImageList(Image *images,const long offset)
 %  It returns MagickTrue if the entry is deleted otherwise MagickFalse if no
 %  entry is found in the registry that matches the id.
 %
+%  Deprecated, replace with:
+%
+%    char key[MaxTextExtent];
+%    FormatMagickString(key,MaxTextExtent,"%ld\n",id);
+%    DeleteImageRegistry(key);
+%
 %  The format of the DeleteMagickRegistry method is:
 %
-%      MagickBooleanType DeleteMagickRegistry(const long id)
+%      MagickBooleanType DeleteMagickRegistry(const ssize_t id)
 %
 %  A description of each parameter follows:
 %
 %    o id: the registry id.
 %
 */
-MagickExport MagickBooleanType DeleteMagickRegistry(const long id)
+MagickExport MagickBooleanType DeleteMagickRegistry(const ssize_t id)
 {
   char
     key[MaxTextExtent];
 
-  (void) FormatMagickString(key,MaxTextExtent,"%ld\n",id);
+  (void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
   return(DeleteImageRegistry(key));
 }
 \f
@@ -1368,6 +1498,29 @@ MagickExport MagickBooleanType DeleteMagickRegistry(const long id)
 %                                                                             %
 %                                                                             %
 %                                                                             %
++   D e s t r o y C o n s t i t u t e                                         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  DestroyConstitute() destroys the constitute component.
+%
+%  The format of the DestroyConstitute method is:
+%
+%      DestroyConstitute(void)
+%
+*/
+MagickExport void DestroyConstitute(void)
+{
+  ConstituteComponentTerminus();
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 +   D e s t r o y M a g i c k R e g i s t r y                                 %
 %                                                                             %
 %                                                                             %
@@ -1376,6 +1529,10 @@ MagickExport MagickBooleanType DeleteMagickRegistry(const long id)
 %
 %  DestroyMagickRegistry() deallocates memory associated the magick registry.
 %
+%  Deprecated, replace with:
+%
+%    RegistryComponentTerminus();
+%
 %  The format of the DestroyMagickRegistry method is:
 %
 %       void DestroyMagickRegistry(void)
@@ -1400,6 +1557,10 @@ MagickExport void DestroyMagickRegistry(void)
 %  DescribeImage() describes an image by printing its attributes to the file.
 %  Attributes include the image width, height, size, and others.
 %
+%  Deprecated, replace with:
+%
+%    IdentifyImage(image,file,verbose);
+%
 %  The format of the DescribeImage method is:
 %
 %      MagickBooleanType DescribeImage(Image *image,FILE *file,
@@ -1468,6 +1629,10 @@ MagickExport void DestroyImageAttributes(Image *image)
 %
 %  DestroyImages() destroys an image list.
 %
+%  Deprecated, replace with:
+%
+%    DestroyImageList(image);
+%
 %  The format of the DestroyImages method is:
 %
 %      void DestroyImages(Image *image)
@@ -1499,6 +1664,10 @@ MagickExport void DestroyImages(Image *image)
 %
 %  DestroyMagick() destroys the ImageMagick environment.
 %
+%  Deprecated, replace with:
+%
+%    MagickCoreTerminus();
+%
 %  The format of the DestroyMagick function is:
 %
 %      DestroyMagick(void)
@@ -1522,7 +1691,7 @@ MagickExport void DestroyMagick(void)
 %
 %  DispatchImage() extracts pixel data from an image and returns it to you.
 %  The method returns MagickFalse on success otherwise MagickTrue if an error is
-%  encountered.  The data is returned as char, short int, int, long, float,
+%  encountered.  The data is returned as char, short int, int, ssize_t, float,
 %  or double in the order specified by map.
 %
 %  Suppose you want to extract the first scanline of a 640x480 image as
@@ -1530,11 +1699,16 @@ MagickExport void DestroyMagick(void)
 %
 %      DispatchImage(image,0,0,640,1,"RGB",CharPixel,pixels,exception);
 %
+%  Deprecated, replace with:
+%
+%    ExportImagePixels(image,x_offset,y_offset,columns,rows,map,type,pixels,
+%      exception);
+%
 %  The format of the DispatchImage method is:
 %
-%      unsigned int DispatchImage(const Image *image,const long x_offset,
-%        const long y_offset,const unsigned long columns,
-%        const unsigned long rows,const char *map,const StorageType type,
+%      unsigned int DispatchImage(const Image *image,const ssize_t x_offset,
+%        const ssize_t y_offset,const size_t columns,
+%        const size_t rows,const char *map,const StorageType type,
 %        void *pixels,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -1561,8 +1735,8 @@ MagickExport void DestroyMagick(void)
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport unsigned int DispatchImage(const Image *image,const long x_offset,
-  const long y_offset,const unsigned long columns,const unsigned long rows,
+MagickExport unsigned int DispatchImage(const Image *image,const ssize_t x_offset,
+  const ssize_t y_offset,const size_t columns,const size_t rows,
   const char *map,const StorageType type,void *pixels,ExceptionInfo *exception)
 {
   unsigned int
@@ -1591,8 +1765,8 @@ MagickExport unsigned int DispatchImage(const Image *image,const long x_offset,
 %
 %  The format of the ExtractSubimageFromImageImage method is:
 %
-%      Image *ExtractSubimageFromImage(const Image *image,const Image *reference,
-%        ExceptionInfo *exception)
+%      Image *ExtractSubimageFromImage(const Image *image,
+%        const Image *reference,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -1605,21 +1779,21 @@ MagickExport unsigned int DispatchImage(const Image *image,const long x_offset,
 */
 
 static double GetSimilarityMetric(const Image *image,const Image *reference,
-  const long x_offset,const long y_offset,const double similarity_threshold,
-  ExceptionInfo *exception)
+  const ssize_t x_offset,const ssize_t y_offset,
+  const double similarity_threshold,ExceptionInfo *exception)
 {
   CacheView
     *image_view,
     *reference_view;
 
-  long
-    y;
-
   double
     channels,
     normalized_similarity,
     similarity;
 
+  ssize_t
+    y;
+
   /*
     Compute the similarity in pixels between two images.
   */
@@ -1633,7 +1807,7 @@ static double GetSimilarityMetric(const Image *image,const Image *reference,
     channels++;
   image_view=AcquireCacheView(image);
   reference_view=AcquireCacheView(reference);
-  for (y=0; y < (long) reference->rows; y++)
+  for (y=0; y < (ssize_t) reference->rows; y++)
   {
     register const IndexPacket
       *indexes,
@@ -1643,7 +1817,7 @@ static double GetSimilarityMetric(const Image *image,const Image *reference,
       *p,
       *q;
 
-    register long
+    register ssize_t
       x;
 
     p=GetCacheViewVirtualPixels(image_view,x_offset,y_offset+y,
@@ -1654,20 +1828,24 @@ static double GetSimilarityMetric(const Image *image,const Image *reference,
       continue;
     indexes=GetCacheViewVirtualIndexQueue(image_view);
     reference_indexes=GetCacheViewVirtualIndexQueue(reference_view);
-    for (x=0; x < (long) reference->columns; x++)
+    for (x=0; x < (ssize_t) reference->columns; x++)
     {
       MagickRealType
         pixel;
 
-      pixel=QuantumScale*(p->red-(double) q->red);
+      pixel=QuantumScale*(GetRedPixelComponent(p)-(double)
+        GetRedPixelComponent(q));
       similarity+=pixel*pixel;
-      pixel=QuantumScale*(p->green-(double) q->green);
+      pixel=QuantumScale*(GetGreenPixelComponent(p)-(double)
+        GetGreenPixelComponent(q));
       similarity+=pixel*pixel;
-      pixel=QuantumScale*(p->blue-(double) q->blue);
+      pixel=QuantumScale*(GetBluePixelComponent(p)-(double)
+        GetBluePixelComponent(q));
       similarity+=pixel*pixel;
       if ((image->matte != MagickFalse) && (reference->matte != MagickFalse))
         {
-          pixel=QuantumScale*(p->opacity-(double) q->opacity);
+          pixel=QuantumScale*(GetOpacityPixelComponent(p)-(double)
+            GetOpacityPixelComponent(q));
           similarity+=pixel*pixel;
         }
       if ((image->colorspace == CMYKColorspace) &&
@@ -1692,34 +1870,34 @@ static double GetSimilarityMetric(const Image *image,const Image *reference,
 MagickExport Image *ExtractSubimageFromImage(Image *image,
   const Image *reference,ExceptionInfo *exception)
 {
-  long
-    y;
-
   double
     similarity_threshold;
 
   RectangleInfo
     offset;
 
+  ssize_t
+    y;
+
   /*
     Extract reference from image.
   */
   if ((reference->columns > image->columns) || (reference->rows > image->rows))
     return((Image *) NULL);
-  similarity_threshold=image->columns*image->rows;
+  similarity_threshold=(double) image->columns*image->rows;
   SetGeometry(reference,&offset);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(dynamic,4)
 #endif
-  for (y=0; y < (long) (image->rows-reference->rows); y++)
+  for (y=0; y < (ssize_t) (image->rows-reference->rows); y++)
   {
     double
       similarity;
 
-    register long
+    register ssize_t
       x;
 
-    for (x=0; x < (long) (image->columns-reference->columns); x++)
+    for (x=0; x < (ssize_t) (image->columns-reference->columns); x++)
     {
       similarity=GetSimilarityMetric(image,reference,x,y,similarity_threshold,
         exception);
@@ -1752,6 +1930,10 @@ MagickExport Image *ExtractSubimageFromImage(Image *image,
 %
 %  FlattenImages() Obsolete Function: Use MergeImageLayers() instead.
 %
+%  Deprecated, replace with:
+%
+%    MergeImageLayers(image,FlattenLayer,exception);
+%
 %  The format of the FlattenImage method is:
 %
 %      Image *FlattenImage(Image *image,ExceptionInfo *exception)
@@ -1881,7 +2063,7 @@ MagickExport void FormatString(char *string,const char *format,...)
     operands;
 
   va_start(operands,format);
-  FormatMagickStringList(string,MaxTextExtent,format,operands);
+  (void) FormatMagickStringList(string,MaxTextExtent,format,operands);
   va_end(operands);
   return;
 }
@@ -1923,18 +2105,20 @@ MagickExport unsigned int FuzzyColorMatch(const PixelPacket *p,
   register MagickRealType
     distance;
 
-  if ((fuzz == 0.0) && (p->red == q->red) && (p->green == q->green) &&
-      (p->blue == q->blue))
+  if ((fuzz == 0.0) && (GetRedPixelComponent(p) == GetRedPixelComponent(q)) &&
+      (GetGreenPixelComponent(p) == GetGreenPixelComponent(q)) &&
+      (GetBluePixelComponent(p) == GetBluePixelComponent(q)))
     return(MagickTrue);
-  pixel.red=p->red-(MagickRealType) q->red;
+  pixel.red=GetRedPixelComponent(p)-(MagickRealType) GetRedPixelComponent(q);
   distance=pixel.red*pixel.red;
   if (distance > (fuzz*fuzz))
     return(MagickFalse);
-  pixel.green=p->green-(MagickRealType) q->green;
+  pixel.green=GetGreenPixelComponent(p)-(MagickRealType)
+    GetGreenPixelComponent(q);
   distance+=pixel.green*pixel.green;
   if (distance > (fuzz*fuzz))
     return(MagickFalse);
-  pixel.blue=p->blue-(MagickRealType) q->blue;
+  pixel.blue=GetBluePixelComponent(p)-(MagickRealType) GetBluePixelComponent(q);
   distance+=pixel.blue*pixel.blue;
   if (distance > (fuzz*fuzz))
     return(MagickFalse);
@@ -1994,6 +2178,10 @@ MagickExport MagickBooleanType FuzzyColorCompare(const Image *image,
 %  method is used by MatteFloodFill() and other algorithms which compare
 %  two opacity values.
 %
+%  Deprecated, replace with:
+%
+%    IsOpacitySimilar(image,p,q);
+%
 %  The format of the FuzzyOpacityCompare method is:
 %
 %      void FuzzyOpacityCompare(const Image *image,const PixelPacket *p,
@@ -2071,7 +2259,7 @@ MagickExport void *GetConfigureBlob(const char *filename,char *path,
         blob=FileToBlob(path,~0,length,exception);
     }
 #endif
-#if defined(__WINDOWS__) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_CONFIGURE_PATH))
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) && !(defined(MAGICKCORE_CONFIGURE_PATH) || defined(MAGICKCORE_SHARE_PATH))
   if (blob == (void *) NULL)
     {
       char
@@ -2154,7 +2342,7 @@ MagickExport void *GetConfigureBlob(const char *filename,char *path,
   */
   if ((blob == (void *) NULL) && (IsPathAccessible(path) != MagickFalse))
     blob=FileToBlob(path,~0,length,exception);
-#if defined(__WINDOWS__)
+#if defined(MAGICKCORE_WINDOWS_SUPPORT)
   /*
     Search Windows registry.
   */
@@ -2183,10 +2371,15 @@ MagickExport void *GetConfigureBlob(const char *filename,char *path,
 %  defined by the geometry parameters.   A pointer to the pixels is returned if
 %  the pixels are transferred, otherwise a NULL is returned.
 %
+%  Deprecated, replace with:
+%
+%    GetCacheViewAuthenticPixels(cache_view,x,y,columns,rows,
+%      GetCacheViewException(cache_view));
+%
 %  The format of the GetCacheView method is:
 %
-%      PixelPacket *GetCacheView(CacheView *cache_view,const long x,
-%        const long y,const unsigned long columns,const unsigned long rows)
+%      PixelPacket *GetCacheView(CacheView *cache_view,const ssize_t x,
+%        const ssize_t y,const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -2196,8 +2389,8 @@ MagickExport void *GetConfigureBlob(const char *filename,char *path,
 %      pixels.
 %
 */
-MagickExport PixelPacket *GetCacheView(CacheView *cache_view,const long x,
-  const long y,const unsigned long columns,const unsigned long rows)
+MagickExport PixelPacket *GetCacheView(CacheView *cache_view,const ssize_t x,
+  const ssize_t y,const size_t columns,const size_t rows)
 {
   PixelPacket
     *pixels;
@@ -2221,6 +2414,10 @@ MagickExport PixelPacket *GetCacheView(CacheView *cache_view,const long x,
 %  GetCacheViewIndexes() returns the indexes associated with the specified
 %  view.
 %
+%  Deprecated, replace with:
+%
+%    GetCacheViewAuthenticIndexQueue(cache_view);
+%
 %  The format of the GetCacheViewIndexes method is:
 %
 %      IndexPacket *GetCacheViewIndexes(CacheView *cache_view)
@@ -2250,10 +2447,15 @@ MagickExport IndexPacket *GetCacheViewIndexes(CacheView *cache_view)
 %  defined by the geometry parameters.   A pointer to the pixels is returned if
 %  the pixels are transferred, otherwise a NULL is returned.
 %
+%  Deprecated, replace with:
+%
+%    GetCacheViewAuthenticPixels(cache_view,x,y,columns,rows,
+%      GetCacheViewException(cache_view));
+%
 %  The format of the GetCacheViewPixels method is:
 %
-%      PixelPacket *GetCacheViewPixels(CacheView *cache_view,const long x,
-%        const long y,const unsigned long columns,const unsigned long rows)
+%      PixelPacket *GetCacheViewPixels(CacheView *cache_view,const ssize_t x,
+%        const ssize_t y,const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -2263,8 +2465,8 @@ MagickExport IndexPacket *GetCacheViewIndexes(CacheView *cache_view)
 %      pixels.
 %
 */
-MagickExport PixelPacket *GetCacheViewPixels(CacheView *cache_view,const long x,
-  const long y,const unsigned long columns,const unsigned long rows)
+MagickExport PixelPacket *GetCacheViewPixels(CacheView *cache_view,const ssize_t x,
+  const ssize_t y,const size_t columns,const size_t rows)
 {
   PixelPacket
     *pixels;
@@ -2339,7 +2541,7 @@ MagickExport const ImageAttribute *GetImageAttribute(const Image *image,
       if (attribute != (const ImageAttribute *) NULL)
         return(attribute);
     }
-  attribute=(ImageAttribute *) AcquireAlignedMemory(1,sizeof(*attribute));
+  attribute=(ImageAttribute *) AcquireMagickMemory(sizeof(*attribute));
   if (attribute == (ImageAttribute *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   (void) ResetMagickMemory(attribute,0,sizeof(*attribute));
@@ -2364,6 +2566,10 @@ MagickExport const ImageAttribute *GetImageAttribute(const Image *image,
 %  GetImageClippingPathAttribute() searches the list of image attributes and
 %  returns a pointer to a clipping path if it exists otherwise NULL.
 %
+%  Deprecated, replace with:
+%
+%    GetImageAttribute(image,"8BIM:1999,2998");
+%
 %  The format of the GetImageClippingPathAttribute method is:
 %
 %      const ImageAttribute *GetImageClippingPathAttribute(Image *image)
@@ -2395,9 +2601,13 @@ MagickExport const ImageAttribute *GetImageClippingPathAttribute(Image *image)
 %  GetImageFromMagickRegistry() gets an image from the registry as defined by
 %  its name.  If the image is not found, a NULL image is returned.
 %
+%  Deprecated, replace with:
+%
+%    GetImageRegistry(ImageRegistryType,name,exception);
+%
 %  The format of the GetImageFromMagickRegistry method is:
 %
-%      Image *GetImageFromMagickRegistry(const char *name,long *id,
+%      Image *GetImageFromMagickRegistry(const char *name,ssize_t *id,
 %        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -2409,7 +2619,7 @@ MagickExport const ImageAttribute *GetImageClippingPathAttribute(Image *image)
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport Image *GetImageFromMagickRegistry(const char *name,long *id,
+MagickExport Image *GetImageFromMagickRegistry(const char *name,ssize_t *id,
   ExceptionInfo *exception)
 {
   *id=0L;
@@ -2432,7 +2642,7 @@ MagickExport Image *GetImageFromMagickRegistry(const char *name,long *id,
 %
 %  The format of the GetMagickRegistry method is:
 %
-%      const void *GetMagickRegistry(const long id,RegistryType *type,
+%      const void *GetMagickRegistry(const ssize_t id,RegistryType *type,
 %        size_t *length,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -2446,7 +2656,7 @@ MagickExport Image *GetImageFromMagickRegistry(const char *name,long *id,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport void *GetMagickRegistry(const long id,RegistryType *type,
+MagickExport void *GetMagickRegistry(const ssize_t id,RegistryType *type,
   size_t *length,ExceptionInfo *exception)
 {
   char
@@ -2457,7 +2667,7 @@ MagickExport void *GetMagickRegistry(const long id,RegistryType *type,
 
   *type=UndefinedRegistryType;
   *length=0;
-  (void) FormatMagickString(key,MaxTextExtent,"%ld\n",id);
+  (void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
   blob=(void *) GetImageRegistry(ImageRegistryType,key,exception);
   if (blob != (void *) NULL)
     return(blob);
@@ -2481,6 +2691,12 @@ MagickExport void *GetMagickRegistry(const long id,RegistryType *type,
 %  GetImageGeometry() returns a region as defined by the geometry string with
 %  respect to the image and its gravity.
 %
+%  Deprecated, replace with:
+%
+%    if (size_to_fit != MagickFalse)
+%      ParseRegionGeometry(image,geometry,region_info,&image->exception); else
+%      ParsePageGeometry(image,geometry,region_info,&image->exception);
+%
 %  The format of the GetImageGeometry method is:
 %
 %      int GetImageGeometry(Image *image,const char *geometry,
@@ -2523,9 +2739,14 @@ MagickExport int GetImageGeometry(Image *image,const char *geometry,
 %
 %  GetImageList() returns an image at the specified position in the list.
 %
+%  Deprecated, replace with:
+%
+%    CloneImage(GetImageFromList(images,(ssize_t) offset),0,0,MagickTrue,
+%      exception);
+%
 %  The format of the GetImageList method is:
 %
-%      Image *GetImageList(const Image *images,const long offset,
+%      Image *GetImageList(const Image *images,const ssize_t offset,
 %        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -2537,7 +2758,7 @@ MagickExport int GetImageGeometry(Image *image,const char *geometry,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport Image *GetImageList(const Image *images,const long offset,
+MagickExport Image *GetImageList(const Image *images,const ssize_t offset,
   ExceptionInfo *exception)
 {
   Image
@@ -2545,7 +2766,7 @@ MagickExport Image *GetImageList(const Image *images,const long offset,
 
   if (images->debug != MagickFalse)
     (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
-  image=CloneImage(GetImageFromList(images,(long) offset),0,0,MagickTrue,
+  image=CloneImage(GetImageFromList(images,(ssize_t) offset),0,0,MagickTrue,
     exception);
   return(image);
 }
@@ -2564,16 +2785,20 @@ MagickExport Image *GetImageList(const Image *images,const long offset,
 %  GetImageListIndex() returns the position in the list of the specified
 %  image.
 %
+%  Deprecated, replace with:
+%
+%    GetImageIndexInList(images);
+%
 %  The format of the GetImageListIndex method is:
 %
-%      long GetImageListIndex(const Image *images)
+%      ssize_t GetImageListIndex(const Image *images)
 %
 %  A description of each parameter follows:
 %
 %    o images: the image list.
 %
 */
-MagickExport long GetImageListIndex(const Image *images)
+MagickExport ssize_t GetImageListIndex(const Image *images)
 {
   if (images->debug != MagickFalse)
     (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
@@ -2593,16 +2818,20 @@ MagickExport long GetImageListIndex(const Image *images)
 %
 %  GetImageListSize() returns the number of images in the list.
 %
+%  Deprecated, replace with:
+%
+%    GetImageListLength(images);
+%
 %  The format of the GetImageListSize method is:
 %
-%      unsigned long GetImageListSize(const Image *images)
+%      size_t GetImageListSize(const Image *images)
 %
 %  A description of each parameter follows:
 %
 %    o images: the image list.
 %
 */
-MagickExport unsigned long GetImageListSize(const Image *images)
+MagickExport size_t GetImageListSize(const Image *images)
 {
   if (images->debug != MagickFalse)
     (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
@@ -2639,10 +2868,14 @@ MagickExport unsigned long GetImageListSize(const Image *images)
 %  array has been updated, the changes must be saved back to the underlying
 %  image using SyncAuthenticPixels() or they may be lost.
 %
+%  Deprecated, replace with:
+%
+%    GetAuthenticPixels(image,x,y,columns,rows,&image->exception);
+%
 %  The format of the GetImagePixels() method is:
 %
-%      PixelPacket *GetImagePixels(Image *image,const long x,const long y,
-%        const unsigned long columns,const unsigned long rows)
+%      PixelPacket *GetImagePixels(Image *image,const ssize_t x,const ssize_t y,
+%        const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -2652,8 +2885,8 @@ MagickExport unsigned long GetImageListSize(const Image *images)
 %      pixels.
 %
 */
-MagickExport PixelPacket *GetImagePixels(Image *image,const long x,const long y,
-  const unsigned long columns,const unsigned long rows)
+MagickExport PixelPacket *GetImagePixels(Image *image,const ssize_t x,const ssize_t y,
+  const size_t columns,const size_t rows)
 {
   return(GetAuthenticPixels(image,x,y,columns,rows,&image->exception));
 }
@@ -2673,6 +2906,10 @@ MagickExport PixelPacket *GetImagePixels(Image *image,const long x,const long y,
 %  with the last call to QueueAuthenticPixels() or GetVirtualPixels().  NULL is
 %  returned if the black channel or colormap indexes are not available.
 %
+%  Deprecated, replace with:
+%
+%    GetAuthenticIndexQueue(image);
+%
 %  The format of the GetIndexes() method is:
 %
 %      IndexPacket *GetIndexes(const Image *image)
@@ -2705,10 +2942,14 @@ MagickExport IndexPacket *GetIndexes(const Image *image)
 %  geometry is modified as determined by the meta characters:  %, !, <, >,
 %  and ~.
 %
+%  Deprecated, replace with:
+%
+%    ParseMetaGeometry(geometry,x,y,width,height);
+%
 %  The format of the GetMagickGeometry method is:
 %
-%      unsigned int GetMagickGeometry(const char *geometry,long *x,long *y,
-%        unsigned long *width,unsigned long *height)
+%      unsigned int GetMagickGeometry(const char *geometry,ssize_t *x,ssize_t *y,
+%        size_t *width,size_t *height)
 %
 %  A description of each parameter follows:
 %
@@ -2722,8 +2963,8 @@ MagickExport IndexPacket *GetIndexes(const Image *image)
 %      as determined by the geometry specification is returned here.
 %
 */
-MagickExport unsigned int GetMagickGeometry(const char *geometry,long *x,
-  long *y,unsigned long *width,unsigned long *height)
+MagickExport unsigned int GetMagickGeometry(const char *geometry,ssize_t *x,
+  ssize_t *y,size_t *width,size_t *height)
 {
   (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.3");
   return(ParseMetaGeometry(geometry,x,y,width,height));
@@ -2742,6 +2983,10 @@ MagickExport unsigned int GetMagickGeometry(const char *geometry,long *x,
 %
 %  GetNextImage() returns the next image in a list.
 %
+%  Deprecated, replace with:
+%
+%    GetNextImageInList(images);
+%
 %  The format of the GetNextImage method is:
 %
 %      Image *GetNextImage(const Image *images)
@@ -2771,6 +3016,13 @@ MagickExport Image *GetNextImage(const Image *images)
 %
 %  GetNextImageAttribute() gets the next image attribute.
 %
+%  Deprecated, replace with:
+%
+%    const char *property;
+%    property=GetNextImageProperty(image);
+%    if (property != (const char *) NULL) 
+%      GetImageAttribute(image,property);
+%
 %  The format of the GetNextImageAttribute method is:
 %
 %      const ImageAttribute *GetNextImageAttribute(const Image *image)
@@ -2804,6 +3056,10 @@ MagickExport const ImageAttribute *GetNextImageAttribute(const Image *image)
 %
 %  GetNumberScenes() returns the number of images in the list.
 %
+%  Deprecated, replace with:
+%
+%    GetImageListLength(image);
+%
 %  The format of the GetNumberScenes method is:
 %
 %      unsigned int GetNumberScenes(const Image *images)
@@ -2834,9 +3090,13 @@ MagickExport unsigned int GetNumberScenes(const Image *image)
 %  GetOnePixel() returns a single pixel at the specified (x,y) location.
 %  The image background color is returned if an error occurs.
 %
+%  Deprecated, replace with:
+%
+%    GetOneAuthenticPixel(image,x,y,&pixel,&image->exception);
+%
 %  The format of the GetOnePixel() method is:
 %
-%      PixelPacket GetOnePixel(const Image image,const long x,const long y)
+%      PixelPacket GetOnePixel(const Image image,const ssize_t x,const ssize_t y)
 %
 %  A description of each parameter follows:
 %
@@ -2845,7 +3105,7 @@ MagickExport unsigned int GetNumberScenes(const Image *image)
 %    o x,y:  These values define the location of the pixel to return.
 %
 */
-MagickExport PixelPacket GetOnePixel(Image *image,const long x,const long y)
+MagickExport PixelPacket GetOnePixel(Image *image,const ssize_t x,const ssize_t y)
 {
   PixelPacket
     pixel;
@@ -2868,6 +3128,10 @@ MagickExport PixelPacket GetOnePixel(Image *image,const long x,const long y)
 %  GetPixels() returns the pixels associated with the last call to
 %  QueueAuthenticPixels() or GetAuthenticPixels().
 %
+%  Deprecated, replace with:
+%
+%    GetAuthenticPixelQueue(image);
+%
 %  The format of the GetPixels() method is:
 %
 %      PixelPacket *GetPixels(const Image image)
@@ -2898,6 +3162,10 @@ MagickExport PixelPacket *GetPixels(const Image *image)
 %
 %  GetPreviousImage() returns the previous image in a list.
 %
+%  Deprecated, replace with:
+%
+%    GetPreviousImageInList(images));
+%
 %  The format of the GetPreviousImage method is:
 %
 %      Image *GetPreviousImage(const Image *images)
@@ -3032,6 +3300,10 @@ MagickExport void IdentityAffine(AffineMatrix *affine)
 %
 %  InitializeMagick() initializes the ImageMagick environment.
 %
+%  Deprecated, replace with:
+%
+%    MagickCoreGenesis(path,MagickFalse);
+%
 %  The format of the InitializeMagick function is:
 %
 %      InitializeMagick(const char *path)
@@ -3151,11 +3423,11 @@ static inline double MeshInterpolate(const PointInfo *delta,const double p,
   return(delta->x*x+delta->y*y+(1.0-delta->x-delta->y)*p);
 }
 
-static inline long NearestNeighbor(MagickRealType x)
+static inline ssize_t NearestNeighbor(MagickRealType x)
 {
   if (x >= 0.0)
-    return((long) (x+0.5));
-  return((long) (x-0.5));
+    return((ssize_t) (x+0.5));
+  return((ssize_t) (x-0.5));
 }
 
 MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
@@ -3171,7 +3443,7 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
   register const PixelPacket
     *p;
 
-  register long
+  register ssize_t
     i;
 
   assert(image != (Image *) NULL);
@@ -3189,8 +3461,8 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
         alpha[16],
         gamma;
 
-      p=GetCacheViewVirtualPixels(image_view,(long) floor(x)-1,(long) floor(y)-
-        1,4,4,exception);
+      p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x)-1,(ssize_t)
+        floor(y)-1,4,4,exception);
       if (p == (const PixelPacket *) NULL)
         break;
       indexes=GetCacheViewVirtualIndexQueue(image_view);
@@ -3232,8 +3504,8 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
       PointInfo
         delta;
 
-      p=GetCacheViewVirtualPixels(image_view,(long) floor(x)-1,(long) floor(y)-
-        1,4,4,exception);
+      p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x)-1,(ssize_t)
+        floor(y)-1,4,4,exception);
       if (p == (const PixelPacket *) NULL)
         break;
       indexes=GetCacheViewVirtualIndexQueue(image_view);
@@ -3273,8 +3545,8 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
       PointInfo
         delta;
 
-      p=GetCacheViewVirtualPixels(image_view,(long) floor(x),(long) floor(y),2,
-        2,exception);
+      p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x),(ssize_t)
+        floor(y),2,2,exception);
       if (p == (const PixelPacket *) NULL)
         break;
       indexes=GetCacheViewVirtualIndexQueue(image_view);
@@ -3331,8 +3603,8 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
 
       geometry.width=4L;
       geometry.height=4L;
-      geometry.x=(long) floor(x)-1L;
-      geometry.y=(long) floor(y)-1L;
+      geometry.x=(ssize_t) floor(x)-1L;
+      geometry.y=(ssize_t) floor(y)-1L;
       excerpt_image=ExcerptImage(image,&geometry,exception);
       if (excerpt_image == (Image *) NULL)
         break;
@@ -3358,8 +3630,8 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
       MagickPixelPacket
         pixels[1];
 
-      p=GetCacheViewVirtualPixels(image_view,(long) floor(x),(long) floor(y),1,
-        1,exception);
+      p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x),(ssize_t)
+        floor(y),1,1,exception);
       if (p == (const PixelPacket *) NULL)
         break;
       indexes=GetCacheViewVirtualIndexQueue(image_view);
@@ -3380,8 +3652,8 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
         delta,
         luminance;
 
-      p=GetCacheViewVirtualPixels(image_view,(long) floor(x),(long) floor(y),
-        2,2,exception);
+      p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x),(ssize_t)
+        floor(y),2,2,exception);
       if (p == (const PixelPacket *) NULL)
         break;
       indexes=GetCacheViewVirtualIndexQueue(image_view);
@@ -3515,10 +3787,6 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
     }
     case SplineInterpolatePixel:
     {
-      long
-        j,
-        n;
-
       MagickPixelPacket
         pixels[16];
 
@@ -3531,8 +3799,12 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
       PointInfo
         delta;
 
-      p=GetCacheViewVirtualPixels(image_view,(long) floor(x)-1,(long) floor(y)-
-        1,4,4,exception);
+      ssize_t
+        j,
+        n;
+
+      p=GetCacheViewVirtualPixels(image_view,(ssize_t) floor(x)-1,(ssize_t)
+        floor(y)-1,4,4,exception);
       if (p == (const PixelPacket *) NULL)
         break;
       indexes=GetCacheViewVirtualIndexQueue(image_view);
@@ -3549,7 +3821,8 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
           alpha[n]=1.0;
           if (image->matte != MagickFalse)
             {
-              alpha[n]=QuantumScale*((MagickRealType) GetAlphaPixelComponent(p));
+              alpha[n]=QuantumScale*((MagickRealType)
+                GetAlphaPixelComponent(p));
               pixels[n].red*=alpha[n];
               pixels[n].green*=alpha[n];
               pixels[n].blue*=alpha[n];
@@ -3590,6 +3863,10 @@ MagickExport MagickPixelPacket InterpolatePixelColor(const Image *image,
 %  InterpretImageAttributes() replaces any embedded formatting characters with
 %  the appropriate image attribute and returns the translated text.
 %
+%  Deprecated, replace with:
+%
+%    InterpretImageProperties(image_info,image,embed_text);
+%
 %  The format of the InterpretImageAttributes method is:
 %
 %      char *InterpretImageAttributes(const ImageInfo *image_info,Image *image,
@@ -3666,7 +3943,7 @@ MagickExport unsigned int IsSubimage(const char *geometry,
 %  LevelImageColor() will map the given color to "black" and "white"
 %  values, limearly spreading out the colors, and level values on a channel by
 %  channel bases, as per LevelImage().  The given colors allows you to specify
-%  different level ranges for each of the color channels seperatally.
+%  different level ranges for each of the color channels separately.
 %
 %  If the boolean 'invert' is set true the image values will modifyed in the
 %  reverse direction. That is any existing "black" and "white" colors in the
@@ -3674,6 +3951,10 @@ MagickExport unsigned int IsSubimage(const char *geometry,
 %  appropriatally.  This effectivally maps a greyscale gradient into the given
 %  color gradient.
 %
+%  Deprecated, replace with:
+%
+%    LevelColorsImageChannel(image,channel,black_color,white_color,invert);
+%
 %  The format of the LevelImageColors method is:
 %
 %  MagickBooleanType LevelImageColors(Image *image,const ChannelType channel,
@@ -3746,6 +4027,10 @@ MagickExport void LiberateMemory(void **memory)
 %
 %  LiberateSemaphoreInfo() relinquishes a semaphore.
 %
+%  Deprecated, replace with:
+%
+%    UnlockSemaphoreInfo(*semaphore_info);
+%
 %  The format of the LiberateSemaphoreInfo method is:
 %
 %      LiberateSemaphoreInfo(void **semaphore_info)
@@ -3774,6 +4059,10 @@ MagickExport void LiberateSemaphoreInfo(SemaphoreInfo **semaphore_info)
 %
 %  MagickIncarnate() initializes the ImageMagick environment.
 %
+%  Deprecated, replace with:
+%
+%    MagickCoreGenesis(path,MagickFalse);
+%
 %  The format of the MagickIncarnate function is:
 %
 %      MagickIncarnate(const char *path)
@@ -3857,6 +4146,13 @@ MagickExport MagickBooleanType MagickMonitor(const char *text,
 %  MapImage() replaces the colors of an image with the closest color from a
 %  reference image.
 %
+%  Deprecated, replace with:
+%
+%     QuantizeInfo quantize_info;
+%     GetQuantizeInfo(&quantize_info);
+%     quantize_info.dither=dither;
+%     RemapImage(&quantize_info,image,map_image);
+%
 %  The format of the MapImage method is:
 %
 %      MagickBooleanType MapImage(Image *image,const Image *map_image,
@@ -3907,6 +4203,13 @@ MagickExport MagickBooleanType MapImage(Image *image,const Image *map_image,
 %  MapImages() replaces the colors of a sequence of images with the closest
 %  color from a reference image.
 %
+%  Deprecated, replace with:
+%
+%     QuantizeInfo quantize_info;
+%     GetQuantizeInfo(&quantize_info);
+%     quantize_info.dither=dither;
+%     RemapImages(&quantize_info,images,map_image);
+%
 %  The format of the MapImage method is:
 %
 %      MagickBooleanType MapImages(Image *images,Image *map_image,
@@ -3964,8 +4267,8 @@ MagickExport MagickBooleanType MapImages(Image *images,const Image *map_image,
 %  The format of the MatteFloodfillImage method is:
 %
 %      MagickBooleanType MatteFloodfillImage(Image *image,
-%        const PixelPacket target,const Quantum opacity,const long x_offset,
-%        const long y_offset,const PaintMethod method)
+%        const PixelPacket target,const Quantum opacity,const ssize_t x_offset,
+%        const ssize_t y_offset,const PaintMethod method)
 %
 %  A description of each parameter follows:
 %
@@ -3982,20 +4285,12 @@ MagickExport MagickBooleanType MapImages(Image *images,const Image *map_image,
 %
 */
 MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
-  const PixelPacket target,const Quantum opacity,const long x_offset,
-  const long y_offset,const PaintMethod method)
+  const PixelPacket target,const Quantum opacity,const ssize_t x_offset,
+  const ssize_t y_offset,const PaintMethod method)
 {
   Image
     *floodplane_image;
 
-  long
-    offset,
-    start,
-    x,
-    x1,
-    x2,
-    y;
-
   MagickBooleanType
     skip;
 
@@ -4005,6 +4300,14 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
   SegmentInfo
     *segment_stack;
 
+  ssize_t
+    offset,
+    start,
+    x,
+    x1,
+    x2,
+    y;
+
   /*
     Check boundary conditions.
   */
@@ -4012,9 +4315,9 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  if ((x_offset < 0) || (x_offset >= (long) image->columns))
+  if ((x_offset < 0) || (x_offset >= (ssize_t) image->columns))
     return(MagickFalse);
-  if ((y_offset < 0) || (y_offset >= (long) image->rows))
+  if ((y_offset < 0) || (y_offset >= (ssize_t) image->rows))
     return(MagickFalse);
   if (SetImageStorageClass(image,DirectClass) == MagickFalse)
     return(MagickFalse);
@@ -4050,7 +4353,7 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
     register const PixelPacket
       *restrict p;
 
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -4060,15 +4363,15 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
       Pop segment off stack.
     */
     s--;
-    x1=(long) s->x1;
-    x2=(long) s->x2;
-    offset=(long) s->y2;
-    y=(long) s->y1+offset;
+    x1=(ssize_t) s->x1;
+    x2=(ssize_t) s->x2;
+    offset=(ssize_t) s->y2;
+    y=(ssize_t) s->y1+offset;
     /*
       Recolor neighboring pixels.
     */
-    p=GetVirtualPixels(image,0,y,(unsigned long) (x1+1),1,&image->exception);
-    q=GetAuthenticPixels(floodplane_image,0,y,(unsigned long) (x1+1),1,
+    p=GetVirtualPixels(image,0,y,(size_t) (x1+1),1,&image->exception);
+    q=GetAuthenticPixels(floodplane_image,0,y,(size_t) (x1+1),1,
       &image->exception);
     if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
       break;
@@ -4104,7 +4407,7 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
     {
       if (skip == MagickFalse)
         {
-          if (x < (long) image->columns)
+          if (x < (ssize_t) image->columns)
             {
               p=GetVirtualPixels(image,x,y,image->columns-x,1,
                 &image->exception);
@@ -4113,7 +4416,7 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
               if ((p == (const PixelPacket *) NULL) ||
                   (q == (PixelPacket *) NULL))
                 break;
-              for ( ; x < (long) image->columns; x++)
+              for ( ; x < (ssize_t) image->columns; x++)
               {
                 if (q->opacity == (Quantum) TransparentOpacity)
                   break;
@@ -4140,9 +4443,9 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
       x++;
       if (x <= x2)
         {
-          p=GetVirtualPixels(image,x,y,(unsigned long) (x2-x+1),1,
+          p=GetVirtualPixels(image,x,y,(size_t) (x2-x+1),1,
             &image->exception);
-          q=GetAuthenticPixels(floodplane_image,x,y,(unsigned long) (x2-x+1),1,
+          q=GetAuthenticPixels(floodplane_image,x,y,(size_t) (x2-x+1),1,
             &image->exception);
           if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
             break;
@@ -4165,12 +4468,12 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
       start=x;
     } while (x <= x2);
   }
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < (ssize_t) image->rows; y++)
   {
     register const PixelPacket
       *restrict p;
 
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -4184,9 +4487,9 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
     q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
     if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
       break;
-    for (x=0; x < (long) image->columns; x++)
+    for (x=0; x < (ssize_t) image->columns; x++)
     {
-      if (p->opacity != OpaqueOpacity)
+      if (GetOpacityPixelComponent(p) != OpaqueOpacity)
         q->opacity=opacity;
       p++;
       q++;
@@ -4196,7 +4499,157 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
   }
   segment_stack=(SegmentInfo *) RelinquishMagickMemory(segment_stack);
   floodplane_image=DestroyImage(floodplane_image);
-  return(y == (long) image->rows ? MagickTrue : MagickFalse);
+  return(y == (ssize_t) image->rows ? MagickTrue : MagickFalse);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%     M a x i m u m I m a g e s                                               %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MaximumImages() returns the maximum intensity of an image sequence.
+%
+%  Deprecated, replace with:
+%
+%    EvaluateImages(images,MinEvaluateOperator,exception);
+%
+%  The format of the MaxImages method is:
+%
+%      Image *MaximumImages(Image *images,ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o images: the image sequence.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *MaximumImages(const Image *images,ExceptionInfo *exception)
+{
+  return(EvaluateImages(images,MinEvaluateOperator,exception));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%     M i n i m u m I m a g e s                                               %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MinimumImages() returns the minimum intensity of an image sequence.
+%
+%  Deprecated, replace with:
+%
+%    EvaluateImages(images,MinEvaluateOperator,exception);
+%
+%  The format of the MinimumImages method is:
+%
+%      Image *MinimumImages(Image *images,ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o images: the image sequence.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *MinimumImages(const Image *images,ExceptionInfo *exception)
+{
+  return(EvaluateImages(images,MinEvaluateOperator,exception));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%     M e d i a n F i l t e r I m a g e                                       %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MedianFilterImage() applies a digital filter that improves the quality
+%  of a noisy image.  Each pixel is replaced by the median in a set of
+%  neighboring pixels as defined by radius.
+%
+%  The algorithm was contributed by Mike Edmonds and implements an insertion
+%  sort for selecting median color-channel values.  For more on this algorithm
+%  see "Skip Lists: A probabilistic Alternative to Balanced Trees" by William
+%  Pugh in the June 1990 of Communications of the ACM.
+%
+%  The format of the MedianFilterImage method is:
+%
+%      Image *MedianFilterImage(const Image *image,const double radius,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o radius: the radius of the pixel neighborhood.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *MedianFilterImage(const Image *image,const double radius,
+  ExceptionInfo *exception)
+{
+  Image
+    *median_image;
+
+  median_image=StatisticImage(image,MedianStatistic,(size_t) radius,(size_t)
+    radius,exception);
+  return(median_image);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%     M o d e I m a g e                                                       %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  ModeImage() makes each pixel the 'predominate color' of the neighborhood
+%  of the specified radius.
+%
+%  The format of the ModeImage method is:
+%
+%      Image *ModeImage(const Image *image,const double radius,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o radius: the radius of the pixel neighborhood.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *ModeImage(const Image *image,const double radius,
+  ExceptionInfo *exception)
+{
+  Image
+    *mode_image;
+
+  mode_image=StatisticImage(image,ModeStatistic,(size_t) radius,(size_t) radius,
+    exception);
+  return(mode_image);
 }
 \f
 /*
@@ -4212,6 +4665,10 @@ MagickExport MagickBooleanType MatteFloodfillImage(Image *image,
 %
 %  MosaicImages() Obsolete Function: Use MergeImageLayers() instead.
 %
+%  Deprecated, replace with:
+%
+%    MergeImageLayers(image,MosaicLayer,exception);
+%
 %  The format of the MosaicImage method is:
 %
 %      Image *MosaicImages(const Image *image,ExceptionInfo *exception)
@@ -4267,15 +4724,15 @@ MagickExport MagickBooleanType OpaqueImage(Image *image,
 {
 #define OpaqueImageTag  "Opaque/Image"
 
-  long
-    y;
-
   MagickBooleanType
     proceed;
 
-  register long
+  register ssize_t
     i;
 
+  ssize_t
+    y;
+
   /*
     Make image color opaque.
   */
@@ -4292,9 +4749,9 @@ MagickExport MagickBooleanType OpaqueImage(Image *image,
       /*
         Make DirectClass image opaque.
       */
-      for (y=0; y < (long) image->rows; y++)
+      for (y=0; y < (ssize_t) image->rows; y++)
       {
-        register long
+        register ssize_t
           x;
 
         register PixelPacket
@@ -4303,7 +4760,7 @@ MagickExport MagickBooleanType OpaqueImage(Image *image,
         q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
         if (q == (PixelPacket *) NULL)
           break;
-        for (x=0; x < (long) image->columns; x++)
+        for (x=0; x < (ssize_t) image->columns; x++)
         {
           if (IsColorSimilar(image,q,&target) != MagickFalse)
             *q=fill;
@@ -4311,7 +4768,8 @@ MagickExport MagickBooleanType OpaqueImage(Image *image,
         }
         if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
           break;
-        proceed=SetImageProgress(image,OpaqueImageTag,y,image->rows);
+        proceed=SetImageProgress(image,OpaqueImageTag,(MagickOffsetType) y,
+          image->rows);
         if (proceed == MagickFalse)
           break;
       }
@@ -4322,16 +4780,16 @@ MagickExport MagickBooleanType OpaqueImage(Image *image,
       /*
         Make PseudoClass image opaque.
       */
-      for (i=0; i < (long) image->colors; i++)
+      for (i=0; i < (ssize_t) image->colors; i++)
       {
         if (IsColorSimilar(image,&image->colormap[i],&target) != MagickFalse)
           image->colormap[i]=fill;
       }
       if (fill.opacity != OpaqueOpacity)
         {
-          for (y=0; y < (long) image->rows; y++)
+          for (y=0; y < (ssize_t) image->rows; y++)
           {
-            register long
+            register ssize_t
               x;
 
             register PixelPacket
@@ -4340,7 +4798,7 @@ MagickExport MagickBooleanType OpaqueImage(Image *image,
             q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
             if (q == (PixelPacket *) NULL)
               break;
-            for (x=0; x < (long) image->columns; x++)
+            for (x=0; x < (ssize_t) image->columns; x++)
             {
               if (IsColorSimilar(image,q,&target) != MagickFalse)
                 q->opacity=fill.opacity;
@@ -4373,6 +4831,10 @@ MagickExport MagickBooleanType OpaqueImage(Image *image,
 %  OpenCacheView() opens a view into the pixel cache, using the
 %  VirtualPixelMethod that is defined within the given image itself.
 %
+%  Deprecated, replace with:
+%
+%    AcquireCacheView(image);
+%
 %  The format of the OpenCacheView method is:
 %
 %      CacheView *OpenCacheView(const Image *image)
@@ -4410,11 +4872,16 @@ MagickExport CacheView *OpenCacheView(const Image *image)
 %  color red at intensities of 100 and 102 respectively are now
 %  interpreted as the same color for the purposes of the floodfill.
 %
+%  Deprecated, replace with:
+%
+%    FloodfillPaintImage(image,channel,draw_info,target,x,y,
+%      method == FloodfillMethod ? MagickFalse : MagickTrue);
+%
 %  The format of the PaintFloodfillImage method is:
 %
 %      MagickBooleanType PaintFloodfillImage(Image *image,
-%        const ChannelType channel,const MagickPixelPacket target,const long x,
-%        const long y,const DrawInfo *draw_info,const PaintMethod method)
+%        const ChannelType channel,const MagickPixelPacket target,const ssize_t x,
+%        const ssize_t y,const DrawInfo *draw_info,const PaintMethod method)
 %
 %  A description of each parameter follows:
 %
@@ -4432,8 +4899,8 @@ MagickExport CacheView *OpenCacheView(const Image *image)
 %
 */
 MagickExport MagickBooleanType PaintFloodfillImage(Image *image,
-  const ChannelType channel,const MagickPixelPacket *target,const long x,
-  const long y,const DrawInfo *draw_info,const PaintMethod method)
+  const ChannelType channel,const MagickPixelPacket *target,const ssize_t x,
+  const ssize_t y,const DrawInfo *draw_info,const PaintMethod method)
 {
   MagickBooleanType
     status;
@@ -4461,6 +4928,11 @@ MagickExport MagickBooleanType PaintFloodfillImage(Image *image,
 %  For example, set fuzz to 10 and the color red at intensities of 100 and
 %  102 respectively are now interpreted as the same color.
 %
+%  Deprecated, replace with:
+%
+%    OpaquePaintImageChannel(image,DefaultChannels,target,fill,MagickFalse);
+%    OpaquePaintImageChannel(image,channel,target,fill,MagickFalse);
+%
 %  The format of the PaintOpaqueImage method is:
 %
 %      MagickBooleanType PaintOpaqueImage(Image *image,
@@ -4518,6 +4990,10 @@ MagickExport MagickBooleanType PaintOpaqueImageChannel(Image *image,
 %  For example, set fuzz to 10 and the color red at intensities of 100 and
 %  102 respectively are now interpreted as the same color.
 %
+%  Deprecated, replace with:
+%
+%    TransparentPaintImage(image,target,opacity,MagickFalse);
+%
 %  The format of the PaintTransparentImage method is:
 %
 %      MagickBooleanType PaintTransparentImage(Image *image,
@@ -4553,10 +5029,14 @@ MagickExport MagickBooleanType PaintTransparentImage(Image *image,
 %  geometry is modified as determined by the meta characters:  %, !, <,
 %  and >.
 %
+%  Deprecated, replace with:
+%
+%    ParseMetaGeometry(geometry,x,y,width,height);
+%
 %  The format of the ParseImageGeometry method is:
 %
-%      int ParseImageGeometry(char *geometry,long *x,long *y,
-%        unsigned long *width,unsigned long *height)
+%      int ParseImageGeometry(char *geometry,ssize_t *x,ssize_t *y,
+%        size_t *width,size_t *height)
 %
 %  A description of each parameter follows:
 %
@@ -4573,8 +5053,8 @@ MagickExport MagickBooleanType PaintTransparentImage(Image *image,
 %      as determined by the geometry specification is returned here.
 %
 */
-MagickExport int ParseImageGeometry(const char *geometry,long *x,long *y,
-  unsigned long *width,unsigned long *height)
+MagickExport int ParseImageGeometry(const char *geometry,ssize_t *x,ssize_t *y,
+  size_t *width,size_t *height)
 {
   (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.1");
   return((int) ParseMetaGeometry(geometry,x,y,width,height));
@@ -4594,6 +5074,11 @@ MagickExport int ParseImageGeometry(const char *geometry,long *x,long *y,
 %  ParseSizeGeometry() returns a region as defined by the geometry string with
 %  respect to the image dimensions and aspect ratio.
 %
+%  Deprecated, replace with:
+%
+%    ParseMetaGeometry(geometry,&region_info->x,&region_info->y,
+%      &region_info->width,&region_info->height);
+%
 %  The format of the ParseSizeGeometry method is:
 %
 %      MagickStatusType ParseSizeGeometry(const Image *image,
@@ -4632,6 +5117,10 @@ MagickExport MagickStatusType ParseSizeGeometry(const Image *image,
 %
 %  PopImageList() removes the last image in the list.
 %
+%  Deprecated, replace with:
+%
+%    RemoveLastImageFromList(images);
+%
 %  The format of the PopImageList method is:
 %
 %      Image *PopImageList(Image **images)
@@ -4709,6 +5198,10 @@ MagickExport size_t PopImagePixels(Image *image,const QuantumType quantum,
 %  PostscriptGeometry() replaces any page mneumonic with the equivalent size in
 %  picas.
 %
+%  Deprecated, replace with:
+%
+%    GetPageGeometry(page);
+%
 %  The format of the PostscriptGeometry method is:
 %
 %      char *PostscriptGeometry(const char *page)
@@ -4739,6 +5232,10 @@ MagickExport char *PostscriptGeometry(const char *page)
 %
 %  PushImageList() adds an image to the end of the list.
 %
+%  Deprecated, replace with:
+%
+%    AppendImageToList(images,CloneImageList(image,exception));
+%
 %  The format of the PushImageList method is:
 %
 %      unsigned int PushImageList(Image *images,const Image *image,
@@ -4840,6 +5337,9 @@ MagickExport size_t PushImagePixels(Image *image,const QuantumType quantum,
 %      distance measure is normalized to a range between 0 and 1.  It is
 %      independent of the range of red, green, and blue values in your image.
 %
+%  Deprecated, replace with:
+%
+%    GetImageQuantizeError(image);
 %
 %  The format of the QuantizationError method is:
 %
@@ -4900,13 +5400,13 @@ MagickExport unsigned int RandomChannelThresholdImage(Image *image,const char
     lower_threshold,
     upper_threshold;
 
-  long
-    count,
-    y;
-
   RandomInfo
     *random_info;
 
+  ssize_t
+    count,
+    y;
+
   static MagickRealType
     o2[4]={0.2f, 0.6f, 0.8f, 0.4f},
     o3[9]={0.1f, 0.6f, 0.3f, 0.7f, 0.5f, 0.8f, 0.4f, 0.9f, 0.2f},
@@ -4914,7 +5414,7 @@ MagickExport unsigned int RandomChannelThresholdImage(Image *image,const char
       1.2f, 0.4f, 0.9f, 1.3f, 0.2f},
     threshold=128;
 
-  unsigned long
+  size_t
     order;
 
   /*
@@ -4943,7 +5443,7 @@ MagickExport unsigned int RandomChannelThresholdImage(Image *image,const char
           order=1;
           lower_threshold=0;
           upper_threshold=0;
-          count=sscanf(thresholds,"%lf[/x%%]%lf",&lower_threshold,
+          count=(ssize_t) sscanf(thresholds,"%lf[/x%%]%lf",&lower_threshold,
             &upper_threshold);
           if (strchr(thresholds,'%') != (char *) NULL)
             {
@@ -4965,9 +5465,9 @@ MagickExport unsigned int RandomChannelThresholdImage(Image *image,const char
       ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
         image->filename);
   random_info=AcquireRandomInfo();
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < (ssize_t) image->rows; y++)
   {
-    register long
+    register ssize_t
       x;
 
     register IndexPacket
@@ -4984,42 +5484,42 @@ MagickExport unsigned int RandomChannelThresholdImage(Image *image,const char
         LocaleCompare(channel,"intensity") == 0)
       {
         indexes=GetAuthenticIndexQueue(image);
-        for (x=0; x < (long) image->columns; x++)
-          {
-            MagickRealType
-              intensity;
+        for (x=0; x < (ssize_t) image->columns; x++)
+        {
+          MagickRealType
+            intensity;
 
-            intensity=(MagickRealType) PixelIntensityToQuantum(q);
-            if (order == 1)
-              {
-                if (intensity < lower_threshold)
-                  threshold=lower_threshold;
-                else if (intensity > upper_threshold)
-                  threshold=upper_threshold;
-                else
-                  threshold=(MagickRealType) (QuantumRange*
-                    GetPseudoRandomValue(random_info));
-              }
-            else if (order == 2)
-              threshold=(MagickRealType) QuantumRange*o2[(x%2)+2*(y%2)];
-            else if (order == 3)
-              threshold=(MagickRealType) QuantumRange*o3[(x%3)+3*(y%3)];
-            else if (order == 4)
-              threshold=(MagickRealType) QuantumRange*o4[(x%4)+4*(y%4)];
-            q->red=q->green=q->blue=(Quantum) (intensity <=
-               threshold ? 0 : QuantumRange);
-            index=(IndexPacket) (intensity <= threshold ? 0 : 1);
-            *indexes++=index;
-            q->red=q->green=q->blue=image->colormap[(long) index].red;
-            q++;
-          }
+          intensity=(MagickRealType) PixelIntensityToQuantum(q);
+          if (order == 1)
+            {
+              if (intensity < lower_threshold)
+                threshold=lower_threshold;
+              else if (intensity > upper_threshold)
+                threshold=upper_threshold;
+              else
+                threshold=(MagickRealType) (QuantumRange*
+                  GetPseudoRandomValue(random_info));
+            }
+          else if (order == 2)
+            threshold=(MagickRealType) QuantumRange*o2[(x%2)+2*(y%2)];
+          else if (order == 3)
+            threshold=(MagickRealType) QuantumRange*o3[(x%3)+3*(y%3)];
+          else if (order == 4)
+            threshold=(MagickRealType) QuantumRange*o4[(x%4)+4*(y%4)];
+          index=(IndexPacket) (intensity <= threshold ? 0 : 1);
+          SetIndexPixelComponent(indexes+x,index);
+          SetRedPixelComponent(q,image->colormap[(ssize_t) index].red);
+          SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green);
+          SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue);
+          q++;
+        }
       }
     if (LocaleCompare(channel,"opacity") == 0 ||
         LocaleCompare(channel,"all") == 0 ||
         LocaleCompare(channel,"matte") == 0)
       {
         if (image->matte != MagickFalse)
-          for (x=0; x < (long) image->columns; x++)
+          for (x=0; x < (ssize_t) image->columns; x++)
             {
               if (order == 1)
                 {
@@ -5037,8 +5537,8 @@ MagickExport unsigned int RandomChannelThresholdImage(Image *image,const char
                 threshold=(MagickRealType) QuantumRange*o3[(x%3)+3*(y%3)];
               else if (order == 4)
                 threshold=(MagickRealType) QuantumRange*o4[(x%4)+4*(y%4)]/1.7;
-              q->opacity=(Quantum) ((MagickRealType) q->opacity <= threshold ?
-                 0 : QuantumRange);
+              SetOpacityPixelComponent(q,(MagickRealType) q->opacity <=
+                threshold ? 0 : QuantumRange);
               q++;
             }
       }
@@ -5106,6 +5606,103 @@ MagickExport void ReacquireMemory(void **memory,const size_t size)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%     R e c o l o r I m a g e                                                 %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  RecolorImage() 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 RecolorImage method is:
+%
+%      Image *RecolorImage(const Image *image,const size_t order,
+%        const double *color_matrix,ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o order: the number of columns and rows in the recolor matrix.
+%
+%    o color_matrix: An array of double representing the recolor matrix.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *RecolorImage(const Image *image,const size_t order,
+  const double *color_matrix,ExceptionInfo *exception)
+{
+  KernelInfo
+    *kernel_info;
+
+  Image
+    *recolor_image;
+
+  kernel_info=AcquireKernelInfo("1");
+  if (kernel_info == (KernelInfo *) NULL)
+    return((Image *) NULL);
+  kernel_info->width=order;
+  kernel_info->height=order;
+  kernel_info->values=(double *) color_matrix;
+  recolor_image=ColorMatrixImage(image,kernel_info,exception);
+  kernel_info->values=(double *) NULL;
+  kernel_info=DestroyKernelInfo(kernel_info);
+  return(recolor_image);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%     R e d u c e N o i s e I m a g e                                         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  ReduceNoiseImage() smooths the contours of an image while still preserving
+%  edge information.  The algorithm works by replacing each pixel with its
+%  neighbor closest in value.  A neighbor is defined by radius.  Use a radius
+%  of 0 and ReduceNoise() selects a suitable radius for you.
+%
+%  The format of the ReduceNoiseImage method is:
+%
+%      Image *ReduceNoiseImage(const Image *image,const double radius,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o radius: the radius of the pixel neighborhood.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *ReduceNoiseImage(const Image *image,const double radius,
+  ExceptionInfo *exception)
+{
+  Image
+    *reduce_image;
+
+  reduce_image=StatisticImage(image,NonpeakStatistic,(size_t) radius,(size_t)
+    radius,exception);
+  return(reduce_image);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   R e s e t I m a g e A t t r i b u t e I t e r a t o r                     %
 %                                                                             %
 %                                                                             %
@@ -5116,6 +5713,10 @@ MagickExport void ReacquireMemory(void **memory,const size_t size)
 %  in conjunction with GetNextImageAttribute() to iterate over all the values
 %  associated with an image.
 %
+%  Deprecated, replace with:
+%
+%    ResetImagePropertyIterator(image);
+%
 %  The format of the ResetImageAttributeIterator method is:
 %
 %      ResetImageAttributeIterator(const ImageInfo *image)
@@ -5145,10 +5746,15 @@ MagickExport void ResetImageAttributeIterator(const Image *image)
 %  defined by the geometry parameters.   A pointer to the pixels is returned
 %  if the pixels are transferred, otherwise a NULL is returned.
 %
+%  Deprecated, replace with:
+%
+%    QueueCacheViewAuthenticPixels(cache_view,x,y,columns,rows,
+%      GetCacheViewException(cache_view));
+%
 %  The format of the SetCacheViewPixels method is:
 %
-%      PixelPacket *SetCacheViewPixels(CacheView *cache_view,const long x,
-%        const long y,const unsigned long columns,const unsigned long rows)
+%      PixelPacket *SetCacheViewPixels(CacheView *cache_view,const ssize_t x,
+%        const ssize_t y,const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -5158,8 +5764,8 @@ MagickExport void ResetImageAttributeIterator(const Image *image)
 %      pixels.
 %
 */
-MagickExport PixelPacket *SetCacheViewPixels(CacheView *cache_view,const long x,
-  const long y,const unsigned long columns,const unsigned long rows)
+MagickExport PixelPacket *SetCacheViewPixels(CacheView *cache_view,const ssize_t x,
+  const ssize_t y,const size_t columns,const size_t rows)
 {
   PixelPacket
     *pixels;
@@ -5194,7 +5800,7 @@ MagickExport PixelPacket *SetCacheViewPixels(CacheView *cache_view,const long x,
 %      cache.
 %
 */
-MagickExport void SetCacheThreshold(const unsigned long size)
+MagickExport void SetCacheThreshold(const size_t size)
 {
   (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.1");
   (void) SetMagickResourceLimit(MemoryResource,size*1024*1024);
@@ -5264,12 +5870,12 @@ MagickExport MagickBooleanType SetExceptionInfo(ExceptionInfo *exception,
 */
 MagickExport void SetImage(Image *image,const Quantum opacity)
 {
-  long
-    y;
-
   PixelPacket
     background_color;
 
+  ssize_t
+    y;
+
   (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v6.2.0");
   assert(image != (Image *) NULL);
   if (image->debug != MagickFalse)
@@ -5289,12 +5895,12 @@ MagickExport void SetImage(Image *image,const Quantum opacity)
       /*
         Set colormapped or CMYK image.
       */
-      for (y=0; y < (long) image->rows; y++)
+      for (y=0; y < (ssize_t) image->rows; y++)
       {
         register IndexPacket
           *restrict indexes;
 
-        register long
+        register ssize_t
           x;
 
         register PixelPacket
@@ -5303,10 +5909,10 @@ MagickExport void SetImage(Image *image,const Quantum opacity)
         q=QueueAuthenticPixels(image,0,y,image->columns,1,&image->exception);
         if (q == (PixelPacket *) NULL)
           break;
-        for (x=0; x < (long) image->columns; x++)
+        for (x=0; x < (ssize_t) image->columns; x++)
           *q++=background_color;
         indexes=GetAuthenticIndexQueue(image);
-        for (x=0; x < (long) image->columns; x++)
+        for (x=0; x < (ssize_t) image->columns; x++)
           indexes[x]=(IndexPacket) 0;
         if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
           break;
@@ -5316,9 +5922,9 @@ MagickExport void SetImage(Image *image,const Quantum opacity)
   /*
     Set DirectClass image.
   */
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < (ssize_t) image->rows; y++)
   {
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -5327,7 +5933,7 @@ MagickExport void SetImage(Image *image,const Quantum opacity)
     q=QueueAuthenticPixels(image,0,y,image->columns,1,&image->exception);
     if (q == (PixelPacket *) NULL)
       break;
-    for (x=0; x < (long) image->columns; x++)
+    for (x=0; x < (ssize_t) image->columns; x++)
       *q++=background_color;
     if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
       break;
@@ -5349,6 +5955,10 @@ MagickExport void SetImage(Image *image,const Quantum opacity)
 %  attribute value.  If it is not found in the list, the attribute name
 %  and value is added to the list.
 %
+%  Deprecated, replace with:
+%
+%    SetImageProperty(image,key,value);
+%
 %  The format of the SetImageAttribute method is:
 %
 %       MagickBooleanType SetImageAttribute(Image *image,const char *key,
@@ -5386,7 +5996,7 @@ MagickExport MagickBooleanType SetImageAttribute(Image *image,const char *key,
 %  The format of the SetImageList method is:
 %
 %      unsigned int SetImageList(Image *images,const Image *image,
-%        const long offset,ExceptionInfo *exception)
+%        const ssize_t offset,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -5400,12 +6010,12 @@ MagickExport MagickBooleanType SetImageAttribute(Image *image,const char *key,
 %
 */
 MagickExport unsigned int SetImageList(Image **images,const Image *image,
-  const long offset,ExceptionInfo *exception)
+  const ssize_t offset,ExceptionInfo *exception)
 {
   Image
     *clone;
 
-  register long
+  register ssize_t
     i;
 
   (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.5.2");
@@ -5462,10 +6072,14 @@ MagickExport unsigned int SetImageList(Image **images,const Image *image,
 %  array has been updated, the changes must be saved back to the underlying
 %  image using SyncAuthenticPixels() or they may be lost.
 %
+%  Deprecated, replace with:
+%
+%    QueueAuthenticPixels(image,x,y,columns,rows,&image->exception);
+%
 %  The format of the SetImagePixels() method is:
 %
-%      PixelPacket *SetImagePixels(Image *image,const long x,const long y,
-%        const unsigned long columns,const unsigned long rows)
+%      PixelPacket *SetImagePixels(Image *image,const ssize_t x,const ssize_t y,
+%        const size_t columns,const size_t rows)
 %
 %  A description of each parameter follows:
 %
@@ -5478,8 +6092,8 @@ MagickExport unsigned int SetImageList(Image **images,const Image *image,
 %      pixels.
 %
 */
-MagickExport PixelPacket *SetImagePixels(Image *image,const long x,const long y,
-  const unsigned long columns,const unsigned long rows)
+MagickExport PixelPacket *SetImagePixels(Image *image,const ssize_t x,const ssize_t y,
+  const size_t columns,const size_t rows)
 {
   return(QueueAuthenticPixels(image,x,y,columns,rows,&image->exception));
 }
@@ -5500,7 +6114,7 @@ MagickExport PixelPacket *SetImagePixels(Image *image,const long x,const long y,
 %
 %  The format of the SetMagickRegistry method is:
 %
-%      long SetMagickRegistry(const RegistryType type,const void *blob,
+%      ssize_t SetMagickRegistry(const RegistryType type,const void *blob,
 %        const size_t length,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -5515,7 +6129,7 @@ MagickExport PixelPacket *SetImagePixels(Image *image,const long x,const long y,
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport long SetMagickRegistry(const RegistryType type,const void *blob,
+MagickExport ssize_t SetMagickRegistry(const RegistryType type,const void *blob,
   const size_t magick_unused(length),ExceptionInfo *exception)
 {
   char
@@ -5524,10 +6138,10 @@ MagickExport long SetMagickRegistry(const RegistryType type,const void *blob,
   MagickBooleanType
     status;
 
-  static long
+  static ssize_t
     id = 0;
 
-  (void) FormatMagickString(key,MaxTextExtent,"%ld\n",id);
+  (void) FormatMagickString(key,MaxTextExtent,"%.20g\n",(double) id);
   status=SetImageRegistry(type,key,blob,exception);
   if (status == MagickFalse)
     return(-1);
@@ -5586,6 +6200,10 @@ MagickExport MonitorHandler SetMonitorHandler(MonitorHandler handler)
 %
 %  ShiftImageList() removes an image from the beginning of the list.
 %
+%  Deprecated, replace with:
+%
+%    RemoveFirstImageFromList(images);
+%
 %  The format of the ShiftImageList method is:
 %
 %      Image *ShiftImageList(Image **images)
@@ -5614,6 +6232,10 @@ MagickExport Image *ShiftImageList(Image **images)
 %
 %  SizeBlob() returns the current length of the image file or blob.
 %
+%  Deprecated, replace with:
+%
+%    GetBlobSize(image);
+%
 %  The format of the SizeBlob method is:
 %
 %      off_t SizeBlob(Image *image)
@@ -5649,8 +6271,8 @@ MagickExport MagickOffsetType SizeBlob(Image *image)
 %
 %  The format of the SpliceImageList method is:
 %
-%      Image *SpliceImageList(Image *images,const long offset,
-%        const unsigned long length,const Image *splices,
+%      Image *SpliceImageList(Image *images,const ssize_t offset,
+%        const size_t length,const Image *splices,
 %        ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
@@ -5666,13 +6288,13 @@ MagickExport MagickOffsetType SizeBlob(Image *image)
 %    o exception: return any errors or warnings in this structure.
 %
 */
-MagickExport Image *SpliceImageList(Image *images,const long offset,
-  const unsigned long length,const Image *splices,ExceptionInfo *exception)
+MagickExport Image *SpliceImageList(Image *images,const ssize_t offset,
+  const size_t length,const Image *splices,ExceptionInfo *exception)
 {
   Image
     *clone;
 
-  register long
+  register ssize_t
     i;
 
   if (images->debug != MagickFalse)
@@ -5755,6 +6377,10 @@ MagickExport void Strip(char *message)
 %  cache.  It returns MagickTrue if the pixel region is synced, otherwise
 %  MagickFalse.
 %
+%  Deprecated, replace with:
+%
+%    SyncCacheViewAuthenticPixels(cache_view,GetCacheViewException(cache_view));
+%
 %  The format of the SyncCacheView method is:
 %
 %      MagickBooleanType SyncCacheView(CacheView *cache_view)
@@ -5789,6 +6415,10 @@ MagickExport MagickBooleanType SyncCacheView(CacheView *cache_view)
 %  or disk cache.  It returns MagickTrue if the pixel region is flushed,
 %  otherwise MagickFalse.
 %
+%  Deprecated, replace with:
+%
+%    SyncCacheViewAuthenticPixels(cache_view,GetCacheViewException(cache_view));
+%
 %  The format of the SyncCacheViewPixels method is:
 %
 %      MagickBooleanType SyncCacheViewPixels(CacheView *cache_view)
@@ -5825,6 +6455,10 @@ MagickExport MagickBooleanType SyncCacheViewPixels(CacheView *cache_view)
 %  The method returns MagickTrue if the pixel region is synced, otherwise
 %  MagickFalse.
 %
+%  Deprecated, replace with:
+%
+%    SyncAuthenticPixels(image,&image->exception);
+%
 %  The format of the SyncImagePixels() method is:
 %
 %      MagickBooleanType SyncImagePixels(Image *image)
@@ -5902,7 +6536,7 @@ MagickExport unsigned int ThresholdImage(Image *image,const double threshold)
   IndexPacket
     index;
 
-  long
+  ssize_t
     y;
 
   /*
@@ -5917,12 +6551,12 @@ MagickExport unsigned int ThresholdImage(Image *image,const double threshold)
   if (!AcquireImageColormap(image,2))
     ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
       "UnableToThresholdImage");
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < (ssize_t) image->rows; y++)
   {
     register IndexPacket
       *restrict indexes;
 
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -5932,14 +6566,14 @@ MagickExport unsigned int ThresholdImage(Image *image,const double threshold)
     if (q == (PixelPacket *) NULL)
       break;
     indexes=GetAuthenticIndexQueue(image);
-    for (x=0; x < (long) image->columns; x++)
+    for (x=0; x < (ssize_t) image->columns; x++)
     {
-      index=(IndexPacket) ((MagickRealType)
-        PixelIntensityToQuantum(q) <= threshold ? 0 : 1);
-      indexes[x]=index;
-      q->red=image->colormap[(long) index].red;
-      q->green=image->colormap[(long) index].green;
-      q->blue=image->colormap[(long) index].blue;
+      index=(IndexPacket) ((MagickRealType) PixelIntensityToQuantum(q) <=
+        threshold ? 0 : 1);
+      SetIndexPixelComponent(indexes+x,index);
+      SetRedPixelComponent(q,image->colormap[(ssize_t) index].red);
+      SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green);
+      SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue);
       q++;
     }
     if (!SyncAuthenticPixels(image,&image->exception))
@@ -5987,7 +6621,7 @@ MagickExport unsigned int ThresholdImageChannel(Image *image,
   IndexPacket
     index;
 
-  long
+  ssize_t
     y;
 
   unsigned int
@@ -6033,12 +6667,12 @@ MagickExport unsigned int ThresholdImageChannel(Image *image,
       if (pixel.red == 0)
         (void) GetImageDynamicThreshold(image,2.0,2.0,&pixel,&image->exception);
     }
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < (ssize_t) image->rows; y++)
   {
     register IndexPacket
       *restrict indexes;
 
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -6049,27 +6683,24 @@ MagickExport unsigned int ThresholdImageChannel(Image *image,
       break;
     indexes=GetAuthenticIndexQueue(image);
     if (IsMagickGray(&pixel) != MagickFalse)
-      for (x=0; x < (long) image->columns; x++)
+      for (x=0; x < (ssize_t) image->columns; x++)
       {
         index=(IndexPacket) ((MagickRealType)
           PixelIntensityToQuantum(q) <= pixel.red ? 0 : 1);
-        indexes[x]=index;
-        q->red=image->colormap[(long) index].red;
-        q->green=image->colormap[(long) index].green;
-        q->blue=image->colormap[(long) index].blue;
+        SetIndexPixelComponent(indexes+x,index);
+        SetRedPixelComponent(q,image->colormap[(ssize_t) index].red);
+        SetGreenPixelComponent(q,image->colormap[(ssize_t) index].green);
+        SetBluePixelComponent(q,image->colormap[(ssize_t) index].blue);
         q++;
       }
     else
-      for (x=0; x < (long) image->columns; x++)
+      for (x=0; x < (ssize_t) image->columns; x++)
       {
-        q->red=(Quantum) ((MagickRealType)
-          q->red <= pixel.red ? 0 : QuantumRange);
-        q->green=(Quantum) ((MagickRealType)
-          q->green <= pixel.green ? 0 : QuantumRange);
-        q->blue=(Quantum) ((MagickRealType)
-          q->blue <= pixel.blue ? 0 : QuantumRange);
-        q->opacity=(Quantum) ((MagickRealType)
-          q->opacity <= pixel.opacity ? 0 : QuantumRange);
+        SetRedPixelComponent(q,q->red <= pixel.red ? 0 : QuantumRange);
+        SetGreenPixelComponent(q,q->green <= pixel.green ? 0 : QuantumRange);
+        SetBluePixelComponent(q,q->blue <= pixel.blue ? 0 : QuantumRange);
+        SetOpacityPixelComponent(q,q->opacity <= pixel.opacity ? 0 :
+          QuantumRange);
         q++;
       }
     if (!SyncAuthenticPixels(image,&image->exception))
@@ -6096,6 +6727,10 @@ MagickExport unsigned int ThresholdImageChannel(Image *image,
 %  weights are rescaled to normalize the range of the transformed values to
 %  be [0..QuantumRange].
 %
+%  Deprecated, replace with:
+%
+%    TransformImageColorspace(image,colorspace);
+%
 %  The format of the TransformColorspace method is:
 %
 %      unsigned int (void) TransformColorspace(Image *image,
@@ -6208,6 +6843,10 @@ MagickExport void TransformHSL(const Quantum red,const Quantum green,
 %  TranslateText() replaces any embedded formatting characters with the
 %  appropriate image attribute and returns the translated text.
 %
+%  Deprecated, replace with:
+%
+%    InterpretImageProperties(image_info,image,embed_text);
+%
 %  The format of the TranslateText method is:
 %
 %      char *TranslateText(const ImageInfo *image_info,Image *image,
@@ -6272,12 +6911,12 @@ MagickExport MagickBooleanType TransparentImage(Image *image,
 {
 #define TransparentImageTag  "Transparent/Image"
 
-  long
-    y;
-
   MagickBooleanType
     proceed;
 
+  ssize_t
+    y;
+
   /*
     Make image color transparent.
   */
@@ -6288,9 +6927,9 @@ MagickExport MagickBooleanType TransparentImage(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (image->matte == MagickFalse)
     (void) SetImageAlphaChannel(image,OpaqueAlphaChannel);
-  for (y=0; y < (long) image->rows; y++)
+  for (y=0; y < (ssize_t) image->rows; y++)
   {
-    register long
+    register ssize_t
       x;
 
     register PixelPacket
@@ -6299,7 +6938,7 @@ MagickExport MagickBooleanType TransparentImage(Image *image,
     q=GetAuthenticPixels(image,0,y,image->columns,1,&image->exception);
     if (q == (PixelPacket *) NULL)
       break;
-    for (x=0; x < (long) image->columns; x++)
+    for (x=0; x < (ssize_t) image->columns; x++)
     {
       if (IsColorSimilar(image,q,&target) != MagickFalse)
         q->opacity=opacity;
@@ -6307,7 +6946,8 @@ MagickExport MagickBooleanType TransparentImage(Image *image,
     }
     if (SyncAuthenticPixels(image,&image->exception) == MagickFalse)
       break;
-    proceed=SetImageProgress(image,TransparentImageTag,y,image->rows);
+    proceed=SetImageProgress(image,TransparentImageTag,(MagickOffsetType) y,
+      image->rows);
     if (proceed == MagickFalse)
       break;
   }
@@ -6327,6 +6967,10 @@ MagickExport MagickBooleanType TransparentImage(Image *image,
 %
 %  UnshiftImageList() adds the image to the beginning of the list.
 %
+%  Deprecated, replace with:
+%
+%    PrependImageToList(images,CloneImageList(image,exception));
+%
 %  The format of the UnshiftImageList method is:
 %
 %      unsigned int UnshiftImageList(Image *images,const Image *image,
@@ -6364,6 +7008,10 @@ MagickExport unsigned int UnshiftImageList(Image **images,const Image *image,
 %  not range from 0 to the number of colors in the colormap an exception
 %  issued and 0 is returned.
 %
+%  Deprecated, replace with:
+%
+%    ConstrainColormapIndex(image,index);
+%
 %  The format of the ValidateColormapIndex method is:
 %
 %      IndexPacket ValidateColormapIndex(Image *image,const unsigned int index)
@@ -6378,12 +7026,67 @@ MagickExport unsigned int UnshiftImageList(Image **images,const Image *image,
 %    o index: This integer is the colormap index.
 %
 */
-
 MagickExport IndexPacket ValidateColormapIndex(Image *image,
-  const unsigned long index)
+  const size_t index)
 {
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(DeprecateEvent,GetMagickModule(),"last use: v5.4.4");
   return(ConstrainColormapIndex(image,index));
 }
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%   Z o o m I m a g e                                                         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  ZoomImage() creates a new image that is a scaled size of an existing one.
+%  It allocates the memory necessary for the new Image structure and returns a
+%  pointer to the new image.  The Point filter gives fast pixel replication,
+%  Triangle is equivalent to bi-linear interpolation, and Mitchel giver slower,
+%  very high-quality results.  See Graphic Gems III for details on this
+%  algorithm.
+%
+%  The filter member of the Image structure specifies which image filter to
+%  use. Blur specifies the blur factor where > 1 is blurry, < 1 is sharp.
+%
+%  The format of the ZoomImage method is:
+%
+%      Image *ZoomImage(const Image *image,const size_t columns,
+%        const size_t rows,ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o columns: An integer that specifies the number of columns in the zoom
+%      image.
+%
+%    o rows: An integer that specifies the number of rows in the scaled
+%      image.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *ZoomImage(const Image *image,const size_t columns,
+  const size_t rows,ExceptionInfo *exception)
+{
+  Image
+    *zoom_image;
+
+  assert(image != (const Image *) NULL);
+  assert(image->signature == MagickSignature);
+  if (image->debug != MagickFalse)
+    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
+  assert(exception != (ExceptionInfo *) NULL);
+  assert(exception->signature == MagickSignature);
+  zoom_image=ResizeImage(image,columns,rows,image->filter,image->blur,
+    exception);
+  return(zoom_image);
+}
 #endif