]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 6 Mar 2010 02:06:45 +0000 (02:06 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 6 Mar 2010 02:06:45 +0000 (02:06 +0000)
PerlMagick/Magick.xs
magick/statistic.c
magick/statistic.h
utilities/convert.1.in
utilities/mogrify.1.in
wand/convert.c
wand/magick-image.c
wand/magick-image.h
wand/mogrify.c

index 4b61174c2a7955e78366b60c06c51efe5e5b3ccd..a5277d31a8eadade8671822e71742fe12557e64e 100644 (file)
@@ -6398,145 +6398,6 @@ ImageToBlob(ref,...)
 #                                                                             #
 #                                                                             #
 #                                                                             #
-#   I n t e n s i t y P r o j e c t i o n                                     #
-#                                                                             #
-#                                                                             #
-#                                                                             #
-###############################################################################
-#
-#
-void
-IntensityProjection(ref)
-  Image::Magick ref=NO_INIT
-  ALIAS:
-    IntensityProjectionImage   = 1
-    intensityprojection        = 2
-    intensityprojectionimage   = 3
-  PPCODE:
-  {
-    AV
-      *av;
-
-    char
-      *attribute,
-      *p;
-
-    ExceptionInfo
-      *exception;
-
-    HV
-      *hv;
-
-    Image
-      *image;
-
-    MagickBooleanType
-      projection;
-
-    register long
-      i;
-
-    struct PackageInfo
-      *info;
-
-    SV
-      *perl_exception,
-      *reference,
-      *rv,
-      *sv;
-
-    exception=AcquireExceptionInfo();
-    perl_exception=newSVpv("",0);
-    if (sv_isobject(ST(0)) == 0)
-      {
-        ThrowPerlException(exception,OptionError,"ReferenceIsNotMyType",
-          PackageName);
-        goto PerlException;
-      }
-    reference=SvRV(ST(0));
-    hv=SvSTASH(reference);
-    image=SetupList(aTHX_ reference,&info,(SV ***) NULL,exception);
-    if (image == (Image *) NULL)
-      {
-        ThrowPerlException(exception,OptionError,"NoImagesDefined",
-          PackageName);
-        goto PerlException;
-      }
-    projection=MagickFalse;
-    for (i=2; i < items; i+=2)
-    {
-      attribute=(char *) SvPV(ST(i-1),na);
-      switch (*attribute)
-      {
-        case 'P':
-        case 'p':
-        {
-         if (LocaleCompare(attribute,"projection") == 0)
-           {
-             long
-               in;
-
-             in=!SvPOK(ST(i)) ? SvIV(ST(i)) : ParseMagickOption(
-               MagickBooleanOptions,MagickFalse,SvPV(ST(i),na));
-             if (in < 0)
-               {
-                 ThrowPerlException(exception,OptionError,"UnrecognizedType",
-                   SvPV(ST(i),na));
-                 return;
-               }
-             projection=(MagickBooleanType) in;
-             break;
-           }
-          ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
-            attribute);
-          break;
-        }
-        default:
-        {
-          ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
-            attribute);
-          break;
-        }
-      }
-    }
-    image=IntensityProjectionImages(image,MagickFalse,exception);
-    if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
-      goto PerlException;
-    /*
-      Create blessed Perl array for the returned image.
-    */
-    av=newAV();
-    ST(0)=sv_2mortal(sv_bless(newRV((SV *) av),hv));
-    SvREFCNT_dec(av);
-    AddImageToRegistry(image);
-    rv=newRV(sv);
-    av_push(av,sv_bless(rv,hv));
-    SvREFCNT_dec(sv);
-    info=GetPackageInfo(aTHX_ (void *) av,info,exception);
-    (void) FormatMagickString(info->image_info->filename,MaxTextExtent,
-      "mip-%.*s",(int) (MaxTextExtent-9),
-      ((p=strrchr(image->filename,'/')) ? p+1 : image->filename));
-    (void) CopyMagickString(image->filename,info->image_info->filename,
-      MaxTextExtent);
-    SetImageInfo(info->image_info,0,exception);
-    exception=DestroyExceptionInfo(exception);
-    SvREFCNT_dec(perl_exception);
-    XSRETURN(1);
-
-  PerlException:
-    InheritPerlException(exception,perl_exception);
-    exception=DestroyExceptionInfo(exception);
-    sv_setiv(perl_exception,(IV) SvCUR(perl_exception) != 0);
-    SvPOK_on(perl_exception);
-    ST(0)=sv_2mortal(perl_exception);
-    XSRETURN(1);
-  }
-\f
-#
-###############################################################################
-#                                                                             #
-#                                                                             #
-#                                                                             #
 #   L a y e r s                                                               #
 #                                                                             #
 #                                                                             #
@@ -6891,6 +6752,196 @@ MagickToMime(ref,name)
 #                                                                             #
 #                                                                             #
 #                                                                             #
+#   M a x                                                                     #
+#                                                                             #
+#                                                                             #
+#                                                                             #
+###############################################################################
+#
+#
+void
+Max(ref)
+  Image::Magick ref=NO_INIT
+  ALIAS:
+    MaxImage   = 1
+    max        = 2
+    maximage   = 3
+  PPCODE:
+  {
+    AV
+      *av;
+
+    char
+      *p;
+
+    ExceptionInfo
+      *exception;
+
+    HV
+      *hv;
+
+    Image
+      *image;
+
+    struct PackageInfo
+      *info;
+
+    SV
+      *perl_exception,
+      *reference,
+      *rv,
+      *sv;
+
+    exception=AcquireExceptionInfo();
+    perl_exception=newSVpv("",0);
+    if (sv_isobject(ST(0)) == 0)
+      {
+        ThrowPerlException(exception,OptionError,"ReferenceIsNotMyType",
+          PackageName);
+        goto PerlException;
+      }
+    reference=SvRV(ST(0));
+    hv=SvSTASH(reference);
+    image=SetupList(aTHX_ reference,&info,(SV ***) NULL,exception);
+    if (image == (Image *) NULL)
+      {
+        ThrowPerlException(exception,OptionError,"NoImagesDefined",
+          PackageName);
+        goto PerlException;
+      }
+    image=MaxImages(image,exception);
+    if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
+      goto PerlException;
+    /*
+      Create blessed Perl array for the returned image.
+    */
+    av=newAV();
+    ST(0)=sv_2mortal(sv_bless(newRV((SV *) av),hv));
+    SvREFCNT_dec(av);
+    AddImageToRegistry(image);
+    rv=newRV(sv);
+    av_push(av,sv_bless(rv,hv));
+    SvREFCNT_dec(sv);
+    info=GetPackageInfo(aTHX_ (void *) av,info,exception);
+    (void) FormatMagickString(info->image_info->filename,MaxTextExtent,
+      "max-%.*s",(int) (MaxTextExtent-9),
+      ((p=strrchr(image->filename,'/')) ? p+1 : image->filename));
+    (void) CopyMagickString(image->filename,info->image_info->filename,
+      MaxTextExtent);
+    SetImageInfo(info->image_info,0,exception);
+    exception=DestroyExceptionInfo(exception);
+    SvREFCNT_dec(perl_exception);
+    XSRETURN(1);
+
+  PerlException:
+    InheritPerlException(exception,perl_exception);
+    exception=DestroyExceptionInfo(exception);
+    sv_setiv(perl_exception,(IV) SvCUR(perl_exception) != 0);
+    SvPOK_on(perl_exception);
+    ST(0)=sv_2mortal(perl_exception);
+    XSRETURN(1);
+  }
+\f
+#
+###############################################################################
+#                                                                             #
+#                                                                             #
+#                                                                             #
+#   M i n                                                                     #
+#                                                                             #
+#                                                                             #
+#                                                                             #
+###############################################################################
+#
+#
+void
+Min(ref)
+  Image::Magick ref=NO_INIT
+  ALIAS:
+    MinImage   = 1
+    min        = 2
+    minimage   = 3
+  PPCODE:
+  {
+    AV
+      *av;
+
+    char
+      *p;
+
+    ExceptionInfo
+      *exception;
+
+    HV
+      *hv;
+
+    Image
+      *image;
+
+    struct PackageInfo
+      *info;
+
+    SV
+      *perl_exception,
+      *reference,
+      *rv,
+      *sv;
+
+    exception=AcquireExceptionInfo();
+    perl_exception=newSVpv("",0);
+    if (sv_isobject(ST(0)) == 0)
+      {
+        ThrowPerlException(exception,OptionError,"ReferenceIsNotMyType",
+          PackageName);
+        goto PerlException;
+      }
+    reference=SvRV(ST(0));
+    hv=SvSTASH(reference);
+    image=SetupList(aTHX_ reference,&info,(SV ***) NULL,exception);
+    if (image == (Image *) NULL)
+      {
+        ThrowPerlException(exception,OptionError,"NoImagesDefined",
+          PackageName);
+        goto PerlException;
+      }
+    image=MinImages(image,exception);
+    if ((image == (Image *) NULL) || (exception->severity >= ErrorException))
+      goto PerlException;
+    /*
+      Create blessed Perl array for the returned image.
+    */
+    av=newAV();
+    ST(0)=sv_2mortal(sv_bless(newRV((SV *) av),hv));
+    SvREFCNT_dec(av);
+    AddImageToRegistry(image);
+    rv=newRV(sv);
+    av_push(av,sv_bless(rv,hv));
+    SvREFCNT_dec(sv);
+    info=GetPackageInfo(aTHX_ (void *) av,info,exception);
+    (void) FormatMagickString(info->image_info->filename,MaxTextExtent,
+      "max-%.*s",(int) (MaxTextExtent-9),
+      ((p=strrchr(image->filename,'/')) ? p+1 : image->filename));
+    (void) CopyMagickString(image->filename,info->image_info->filename,
+      MaxTextExtent);
+    SetImageInfo(info->image_info,0,exception);
+    exception=DestroyExceptionInfo(exception);
+    SvREFCNT_dec(perl_exception);
+    XSRETURN(1);
+
+  PerlException:
+    InheritPerlException(exception,perl_exception);
+    exception=DestroyExceptionInfo(exception);
+    sv_setiv(perl_exception,(IV) SvCUR(perl_exception) != 0);
+    SvPOK_on(perl_exception);
+    ST(0)=sv_2mortal(perl_exception);
+    XSRETURN(1);
+  }
+\f
+#
+###############################################################################
+#                                                                             #
+#                                                                             #
+#                                                                             #
 #   M o g r i f y                                                             #
 #                                                                             #
 #                                                                             #
index 691f3e8a0aa523153f90e2e2b6af83de4171fca3..3432ee8daecb4a7182c34dfdf4fee133f6cf0e81 100644 (file)
@@ -1132,40 +1132,133 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%     I n t e n s i t y P r o j e c t i o n I m a g e s                       %
+%     M a x I m a g e s                                                       %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  IntensityProjectionImages() returns the maximum (or minimum) intensity
-%  projection of an image sequence.
+%  MaxImages() returns the maximum intensity of an image sequence.
 %
-%  The format of the IntensityProjectionImages method is:
+%  The format of the MaxImages method is:
 %
-%      Image *IntensityProjectionImages(Image *images,
-%        const MagickBooleanType projection,ExceptionInfo *exception)
+%      Image *MaxImages(Image *images,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
 %    o images: the image sequence.
 %
-%    o projection: compute the minimum intensity projection for a value
-%      other than 0, otherwise compute the maximum.
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport Image *MaxImages(const Image *images,ExceptionInfo *exception)
+{
+#define MaxImageTag  "Max/Image"
+
+  const Image
+    *next;
+
+  Image
+    *max_image;
+
+  MagickBooleanType
+    status;
+
+  register long
+    i;
+
+  unsigned long
+    number_images;
+
+  /*
+    Ensure the image are the same size.
+  */
+  assert(images != (Image *) NULL);
+  assert(images->signature == MagickSignature);
+  if (images->debug != MagickFalse)
+    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
+  assert(exception != (ExceptionInfo *) NULL);
+  assert(exception->signature == MagickSignature);
+  for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+    if ((next->columns != images->columns) || (next->rows != images->rows))
+      {
+        (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
+          "ImageWidthsOrHeightsDiffer","`%s'",images->filename);
+        return((Image *) NULL);
+      }
+  /*
+    Initialize maximum itensity image.
+  */
+  max_image=CloneImage(images,0,0,MagickTrue,exception);
+  if (max_image == (Image *) NULL)
+    return((Image *) NULL);
+  if (SetImageStorageClass(max_image,DirectClass) == MagickFalse)
+    {
+      InheritException(exception,&max_image->exception);
+      max_image=DestroyImage(max_image);
+      return((Image *) NULL);
+    }
+  /*
+    Compute the maximum intensity of an image sequence.
+  */
+  i=0;
+  number_images=GetImageListLength(images);
+  for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
+  {
+    status=CompositeImage(max_image,LightenCompositeOp,next,0,0);
+    if (status == MagickFalse)
+      {
+        InheritException(exception,&max_image->exception);
+        max_image=DestroyImage(max_image);
+        break;
+      }
+    if (images->progress_monitor != (MagickProgressMonitor) NULL)
+      {
+        MagickBooleanType
+          proceed;
+
+#if defined(MAGICKCORE_OPENMP_SUPPORT)
+        #pragma omp critical (MagickCore_MaxImages)
+#endif
+        proceed=SetImageProgress(images,MaxImageTag,i++,number_images);
+      }
+  }
+  return(max_image);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%     M i n I m a g e s                                                       %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MinImages() returns the minimum intensity of an image sequence.
+%
+%  The format of the MinImages method is:
+%
+%      Image *MinImages(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 *IntensityProjectionImages(const Image *images,
-  const MagickBooleanType projection,ExceptionInfo *exception)
+MagickExport Image *MinImages(const Image *images,ExceptionInfo *exception)
 {
-#define MIPImageTag  "MIP/Image"
+#define MinImageTag  "Min/Image"
 
   const Image
     *next;
 
   Image
-    *projection_image;
+    *min_image;
 
   MagickBooleanType
     status;
@@ -1193,30 +1286,29 @@ MagickExport Image *IntensityProjectionImages(const Image *images,
         return((Image *) NULL);
       }
   /*
-    Initialize projection_image next attributes.
+    Initialize minimum intensity image.
   */
-  projection_image=CloneImage(images,0,0,MagickTrue,exception);
-  if (projection_image == (Image *) NULL)
+  min_image=CloneImage(images,0,0,MagickTrue,exception);
+  if (min_image == (Image *) NULL)
     return((Image *) NULL);
-  if (SetImageStorageClass(projection_image,DirectClass) == MagickFalse)
+  if (SetImageStorageClass(min_image,DirectClass) == MagickFalse)
     {
-      InheritException(exception,&projection_image->exception);
-      projection_image=DestroyImage(projection_image);
+      InheritException(exception,&min_image->exception);
+      min_image=DestroyImage(min_image);
       return((Image *) NULL);
     }
   /*
-    Compute the maximum (or minimim) intensity projection.
+    Compute the minimum intensity of an image sequence.
   */
   i=0;
   number_images=GetImageListLength(images);
   for (next=images; next != (Image *) NULL; next=GetNextImageInList(next))
   {
-    status=CompositeImage(projection_image,projection != MagickFalse ?
-      DarkenCompositeOp : LightenCompositeOp,next,0,0);
+    status=CompositeImage(min_image,DarkenCompositeOp,next,0,0);
     if (status == MagickFalse)
       {
-        InheritException(exception,&projection_image->exception);
-        projection_image=DestroyImage(projection_image);
+        InheritException(exception,&min_image->exception);
+        min_image=DestroyImage(min_image);
         break;
       }
     if (images->progress_monitor != (MagickProgressMonitor) NULL)
@@ -1225,11 +1317,10 @@ MagickExport Image *IntensityProjectionImages(const Image *images,
           proceed;
 
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-        #pragma omp critical (MagickCore_IntensityProjectionImages)
+        #pragma omp critical (MagickCore_MaxImages)
 #endif
-        proceed=SetImageProgress(images,MIPImageTag,i++,
-          number_images);
+        proceed=SetImageProgress(images,MinImageTag,i++,number_images);
       }
   }
-  return(projection_image);
+  return(min_image);
 }
index b5610bc552e538e9b3c4ca389641b4431b7cfbc4..c5409434cffc1e5568a5a09e8b8b0e54d20403b1 100644 (file)
@@ -30,8 +30,7 @@ typedef struct _ChannelStatistics
   double
     minima,
     maxima,
-    mean,
-    standard_deviation,
+    mean, standard_deviation,
     kurtosis,
     skewness;
 } ChannelStatistics;
@@ -41,8 +40,8 @@ extern MagickExport ChannelStatistics
 
 extern MagickExport Image
   *AverageImages(const Image *,ExceptionInfo *),
-  *IntensityProjectionImages(const Image *,const MagickBooleanType,
-    ExceptionInfo *);
+  *MaxImages(const Image *,ExceptionInfo *),
+  *MinImages(const Image *,ExceptionInfo *);
 
 extern MagickExport MagickBooleanType
   GetImageChannelExtrema(const Image *,const ChannelType,unsigned long *,
index 9853044ec84db140936746c1723a4b1acbe2b341..19052564a611742226ca2c9dc58e10ebd137f184 100644 (file)
@@ -231,8 +231,8 @@ Image Sequence Operators:
   \-flatten             flatten a sequence of images
   \-fx expression       apply mathematical expression to an image channel(s)
   \-hald-clut           apply a Hald color lookup table to the image
-  \-intensity-projection
-                       the maximum (or minimum) intensity projection
+  \-max                 the maximum intensity of an image sequence
+  \-min                 the minimum intensity of an image sequence
   \-morph value         morph an image sequence
   \-mosaic              create a mosaic from an image sequence
   \-process arguments   process the image with a custom image filter
index 4c587e16c6b68fdd5c82e220794a105dd77c1867..67d07e2b388124a724f045c5c4878a25a1091b2a 100644 (file)
@@ -233,8 +233,8 @@ Image Sequence Operators:
   \-flatten             flatten a sequence of images
   \-fx expression       apply mathematical expression to an image channel(s)
   \-hald-clut           apply a Hald color lookup table to the image
-  \-intensity-projection
-                       the maximum (or minimum) intensity projection
+  \-max                 the maximum intensity of an image sequence
+  \-min                 the minimum intensity of an image sequence
   \-morph value         morph an image sequence
   \-mosaic              create a mosaic from an image sequence
   \-process arguments   process the image with a custom image filter
index d00fdb3b3617f1e66ac269fd20f9b1cd657a1b81..d156af624424a3755b31222aaf31eaf662c1be68 100644 (file)
@@ -302,8 +302,8 @@ static MagickBooleanType ConvertUsage(void)
       "-flatten             flatten a sequence of images",
       "-fx expression       apply mathematical expression to an image channel(s)",
       "-hald-clut           apply a Hald color lookup table to the image",
-      "-intensity-projection",
-      "                     the maximum (or minimum) intensity projection",
+      "-max                 return the maximum intensity of an image sequence",
+      "-min                 return the minimum intensity of an image sequence",
       "-morph value         morph an image sequence",
       "-mosaic              create a mosaic from an image sequence",
       "-process arguments   process the image with a custom image filter",
@@ -1609,8 +1609,6 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
               ThrowConvertInvalidArgumentException(option,argv[i]);
             break;
           }
-        if (LocaleCompare("intensity-projection",option+1) == 0)
-          break;
         if (LocaleCompare("intent",option+1) == 0)
           {
             long
@@ -1885,6 +1883,8 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
               ThrowConvertException(OptionError,"MissingArgument",option);
             break;
           }
+        if (LocaleCompare("max",option+1) == 0)
+          break;
         if (LocaleCompare("median",option+1) == 0)
           {
             if (*option == '+')
@@ -1896,6 +1896,8 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info,
               ThrowConvertInvalidArgumentException(option,argv[i]);
             break;
           }
+        if (LocaleCompare("min",option+1) == 0)
+          break;
         if (LocaleCompare("modulate",option+1) == 0)
           {
             if (*option == '+')
index 8eaad2df7ce3396ecd4bc6d3c95452f1d56065d9..87b21ce48fa6641947a622b90756a6575eee5362 100644 (file)
@@ -6457,52 +6457,6 @@ WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k I n t e n s i t y P r o j e c t i o n I m a g e s             %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  MagickIntensityProjectionImages() returns the maximum (or minimum) intensity
-%  projection of an image sequence.
-%
-%  The format of the MagickIntensityProjectionImages method is:
-%
-%      MagickWand *MagickIntensityProjectionImages(MagickWand *wand,
-%        const MagickBooleanType projection)
-%
-%  A description of each parameter follows:
-%
-%    o wand: the magick wand.
-%
-%    o projection: compute the minimum intensity projection for a value
-%      other than 0, otherwise compute the maximum.
-%
-*/
-WandExport MagickWand *MagickIntensityProjectionImages(MagickWand *wand,
-  const MagickBooleanType projection)
-{
-  Image
-    *projection_image;
-
-  assert(wand != (MagickWand *) NULL);
-  assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
-    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
-  if (wand->images == (Image *) NULL)
-    return((MagickWand *) NULL);
-  projection_image=IntensityProjectionImages(wand->images,projection,
-    wand->exception);
-  if (projection_image == (Image *) NULL)
-    return((MagickWand *) NULL);
-  return(CloneMagickWandFromImages(wand,projection_image));
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   M a g i c k I n v e r s e F o u r i e r T r a n s f o r m I m a g e       %
 %                                                                             %
 %                                                                             %
@@ -6817,6 +6771,45 @@ WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   M a g i c k M a x I m a g e s                                             %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickMaxImages() returns the maximum intensity of an image sequence.
+%
+%  The format of the MagickMaxImages method is:
+%
+%      MagickWand *MagickMaxImages(MagickWand *wand)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+*/
+WandExport MagickWand *MagickMaxImages(MagickWand *wand)
+{
+  Image
+    *max_image;
+
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  if (wand->images == (Image *) NULL)
+    return((MagickWand *) NULL);
+  max_image=MaxImages(wand->images,wand->exception);
+  if (max_image == (Image *) NULL)
+    return((MagickWand *) NULL);
+  return(CloneMagickWandFromImages(wand,max_image));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   M a g i c k M e d i a n F i l t e r I m a g e                             %
 %                                                                             %
 %                                                                             %
@@ -6924,6 +6917,45 @@ WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand,
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   M a g i c k M i n I m a g e s                                             %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickMinImages() returns the minimum intensity of an image sequence.
+%
+%  The format of the MagickMinImages method is:
+%
+%      MagickWand *MagickMinImages(MagickWand *wand)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+*/
+WandExport MagickWand *MagickMinImages(MagickWand *wand)
+{
+  Image
+    *min_image;
+
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  if (wand->images == (Image *) NULL)
+    return((MagickWand *) NULL);
+  min_image=MinImages(wand->images,wand->exception);
+  if (min_image == (Image *) NULL)
+    return((MagickWand *) NULL);
+  return(CloneMagickWandFromImages(wand,min_image));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   M a g i c k M i n i f y I m a g e                                         %
 %                                                                             %
 %                                                                             %
index 23ce233bd9df3495d7ee8e2bce791040144543b3..41f036fd7dc1f4e8bcaa29d823da453fca91b072 100644 (file)
@@ -386,7 +386,8 @@ extern WandExport MagickWand
   *MagickGetImageClipMask(MagickWand *),
   *MagickGetImageRegion(MagickWand *,const unsigned long,const unsigned long,
     const long,const long),
-  *MagickIntensityProjectionImages(MagickWand *,const MagickBooleanType),
+  *MagickMaxImages(MagickWand *),
+  *MagickMinImages(MagickWand *),
   *MagickMergeImageLayers(MagickWand *,const ImageLayerMethod),
   *MagickMorphImages(MagickWand *,const unsigned long),
   *MagickMontageImage(MagickWand *,const DrawingWand *,const char *,
index 73c588b49e48adddd9f4167d3ec7a47009d9d5cc..d13b9bc1e930bed948279200811841ffea7d2461 100644 (file)
@@ -3808,8 +3808,8 @@ static MagickBooleanType MogrifyUsage(void)
       "-flatten             flatten a sequence of images",
       "-fx expression       apply mathematical expression to an image channel(s)",
       "-hald-clut           apply a Hald color lookup table to the image",
-      "-intensity-projection",
-      "                     the maximum (or minimum) intensity projection",
+      "-max                 return the maximum intensity of an image sequence",
+      "-min                 return the minimum intensity of an image sequence",
       "-morph value         morph an image sequence",
       "-mosaic              create a mosaic from an image sequence",
       "-process arguments   process the image with a custom image filter",
@@ -5085,8 +5085,6 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
               ThrowMogrifyInvalidArgumentException(option,argv[i]);
             break;
           }
-        if (LocaleCompare("intensity-projection",option+1) == 0)
-          break;
         if (LocaleCompare("intent",option+1) == 0)
           {
             long
@@ -5350,6 +5348,10 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info,
               ThrowMogrifyException(OptionError,"MissingArgument",option);
             break;
           }
+        if (LocaleCompare("max",option+1) == 0)
+          break;
+        if (LocaleCompare("min",option+1) == 0)
+          break;
         if (LocaleCompare("modulate",option+1) == 0)
           {
             if (*option == '+')
@@ -7915,23 +7917,6 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
             *images=GetFirstImageInList(q);
             break;
           }
-        if (LocaleCompare("intensity-projection",option+1) == 0)
-          {
-            Image
-              *projection_image;
-
-            (void) SyncImagesSettings(image_info,*images);
-            projection_image=IntensityProjectionImages(*images,*option == '+' ?
-              MagickTrue : MagickFalse,exception);
-            if (projection_image == (Image *) NULL)
-              {
-                status=MagickFalse;
-                break;
-              }
-            *images=DestroyImageList(*images);
-            *images=projection_image;
-            break;
-          }
         break;
       }
       case 'l':
@@ -8120,6 +8105,38 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
             i++;
             break;
           }
+        if (LocaleCompare("max",option+1) == 0)
+          {
+            Image
+              *max_image;
+
+            (void) SyncImagesSettings(image_info,*images);
+            max_image=MaxImages(*images,exception);
+            if (max_image == (Image *) NULL)
+              {
+                status=MagickFalse;
+                break;
+              }
+            *images=DestroyImageList(*images);
+            *images=max_image;
+            break;
+          }
+        if (LocaleCompare("min",option+1) == 0)
+          {
+            Image
+              *min_image;
+
+            (void) SyncImagesSettings(image_info,*images);
+            min_image=MinImages(*images,exception);
+            if (min_image == (Image *) NULL)
+              {
+                status=MagickFalse;
+                break;
+              }
+            *images=DestroyImageList(*images);
+            *images=min_image;
+            break;
+          }
         if (LocaleCompare("morph",option+1) == 0)
           {
             Image