From f9ab5156844423757aa22d2809c07233d9d23172 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 16 May 2017 21:05:26 -0400 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=31938 --- MagickWand/compare.c | 111 +++++++++++++++++++++++++++++++++++++-- configure | 2 +- utilities/compare.1.in | 17 +++++- utilities/composite.1.in | 2 +- utilities/convert.1.in | 12 ++--- utilities/display.1.in | 2 +- utilities/mogrify.1.in | 2 +- utilities/montage.1.in | 2 +- 8 files changed, 135 insertions(+), 15 deletions(-) diff --git a/MagickWand/compare.c b/MagickWand/compare.c index 307894832..030cba990 100644 --- a/MagickWand/compare.c +++ b/MagickWand/compare.c @@ -95,6 +95,23 @@ static MagickBooleanType CompareUsage(void) "-log format format of debugging information", (char *) NULL }, + *operators[]= + { + "-brightness-contrast geometry", + " improve brightness / contrast of the image", + "-distort method args", + " distort images according to given method ad args", + "-level value adjust the level of image contrast", + "-resize geometry resize the image", + "-rotate degrees apply Paeth rotation to the image", + "-sigmoidal-contrast geometry", + " increase the contrast without saturating highlights or", + "-trim trim image edges" + }, + *sequence_operators[]= + { + "-crop geometry cut out a rectangular region of the image" + }, *settings[]= { "-alpha option on, activate, off, deactivate, set, opaque, copy", @@ -160,6 +177,12 @@ static MagickBooleanType CompareUsage(void) (void) printf("\nImage Settings:\n"); for (p=settings; *p != (char *) NULL; p++) (void) printf(" %s\n",*p); + (void) printf("\nImage Operators:\n"); + for (p=operators; *p != (char *) NULL; p++) + (void) printf(" %s\n",*p); + (void) printf("\nImage Sequence Operators:\n"); + for (p=sequence_operators; *p != (char *) NULL; p++) + (void) printf(" %s\n",*p); (void) printf("\nMiscellaneous Options:\n"); for (p=miscellaneous; *p != (char *) NULL; p++) (void) printf(" %s\n",*p); @@ -351,10 +374,11 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowCompareException(OptionError,"MissingArgument",option); - type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]); + type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse, + argv[i]); if (type < 0) - ThrowCompareException(OptionError,"UnrecognizedAlphaChannelOption", - argv[i]); + ThrowCompareException(OptionError, + "UnrecognizedAlphaChannelOption",argv[i]); break; } if (LocaleCompare("authenticate",option+1) == 0) @@ -368,6 +392,19 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, } ThrowCompareException(OptionError,"UnrecognizedOption",option); } + case 'b': + { + if (LocaleCompare("brightness-contrast",option+1) == 0) + { + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowCompareInvalidArgumentException(option,argv[i]); + break; + } + ThrowCompareException(OptionError,"UnrecognizedOption",option); + } case 'c': { if (LocaleCompare("cache",option+1) == 0) @@ -450,6 +487,17 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, } if (LocaleCompare("concurrent",option+1) == 0) break; + if (LocaleCompare("crop",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowCompareInvalidArgumentException(option,argv[i]); + break; + } ThrowCompareException(OptionError,"UnrecognizedOption",option) } case 'd': @@ -533,6 +581,23 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, dissimilarity_threshold=StringToDouble(argv[i],(char **) NULL); break; } + if (LocaleCompare("distort",option+1) == 0) + { + ssize_t + op; + + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + op=ParseCommandOption(MagickDistortOptions,MagickFalse,argv[i]); + if (op < 0) + ThrowCompareException(OptionError,"UnrecognizedDistortMethod", + argv[i]); + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + break; + } if (LocaleCompare("duration",option+1) == 0) { if (*option == '+') @@ -636,6 +701,15 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, } case 'l': { + if (LocaleCompare("level",option+1) == 0) + { + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowCompareInvalidArgumentException(option,argv[i]); + break; + } if (LocaleCompare("limit",option+1) == 0) { char @@ -793,11 +867,31 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, } if (LocaleCompare("regard-warnings",option+1) == 0) break; + if (LocaleCompare("resize",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowCompareInvalidArgumentException(option,argv[i]); + break; + } if (LocaleNCompare("respect-parentheses",option+1,17) == 0) { respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse; break; } + if (LocaleCompare("rotate",option+1) == 0) + { + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowCompareInvalidArgumentException(option,argv[i]); + break; + } ThrowCompareException(OptionError,"UnrecognizedOption",option) } case 's': @@ -836,6 +930,15 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, ThrowCompareException(OptionError,"MissingArgument",option); break; } + if (LocaleCompare("sigmoidal-contrast",option+1) == 0) + { + i++; + if (i == (ssize_t) argc) + ThrowCompareException(OptionError,"MissingArgument",option); + if (IsGeometry(argv[i]) == MagickFalse) + ThrowCompareInvalidArgumentException(option,argv[i]); + break; + } if (LocaleCompare("similarity-threshold",option+1) == 0) { if (*option == '+') @@ -889,6 +992,8 @@ WandExport MagickBooleanType CompareImagesCommand(ImageInfo *image_info, ThrowCompareException(OptionError,"MissingArgument",option); break; } + if (LocaleCompare("trim",option+1) == 0) + break; if (LocaleCompare("type",option+1) == 0) { ssize_t diff --git a/configure b/configure index 76661976b..ff7576acd 100755 --- a/configure +++ b/configure @@ -4519,7 +4519,7 @@ MAGICK_PATCHLEVEL_VERSION=7 MAGICK_VERSION=7.0.5-7 -MAGICK_GIT_REVISION=20043:448775d:20170514 +MAGICK_GIT_REVISION=20065:a5d49d1:20170516 # Substitute library versioning diff --git a/utilities/compare.1.in b/utilities/compare.1.in index fc5bb772b..21f74b905 100644 --- a/utilities/compare.1.in +++ b/utilities/compare.1.in @@ -11,7 +11,7 @@ For more information about the compare command, point your browser to file://@DO .SH DESCRIPTION Image Settings: \-alpha option on, activate, off, deactivate, set, opaque, copy - \ transparent, extract, background, or shape + transparent, extract, background, or shape \-authenticate value decrypt image with this password \-colorspace type alternate image colorspace \-compose operator set image composite operator @@ -62,6 +62,21 @@ Image Settings: \-virtual-pixel method virtual pixel access method +Image Operators: + \-brightness-contrast geometry + improve brightness / contrast of the image + \-distort method args + distort images according to given method and args + \-level value adjust the level of image contrast + \-resize geometry resize the image + \-rotate degrees apply Paeth rotation to the image + \-sigmoidal-contrast geometry + lightness rescaling using sigmoidal contrast enhancement + \-trim trim image edges + +Image Sequence Operators: + \-crop geometry cut out a rectangular region of the image + Miscellaneous Options: \-channel mask set the image channel mask \-debug events display copious debugging information diff --git a/utilities/composite.1.in b/utilities/composite.1.in index 1e3597a64..3a7422199 100644 --- a/utilities/composite.1.in +++ b/utilities/composite.1.in @@ -12,7 +12,7 @@ For more information about the composite command, point your browser to file://@ Image Settings: \-affine matrix affine transform matrix \-alpha option on, activate, off, deactivate, set, opaque, copy - \ transparent, extract, background, or shape + transparent, extract, background, or shape \-authenticate value decrypt image with this password \-blue-primary point chromaticity blue primary point \-colorspace type alternate image colorspace diff --git a/utilities/convert.1.in b/utilities/convert.1.in index 56b4ad2e3..09ccbd28b 100644 --- a/utilities/convert.1.in +++ b/utilities/convert.1.in @@ -59,10 +59,10 @@ Image Settings: \-intent type type of rendering intent when managing the image color \-interlace type type of image interlacing scheme \-interline-spacing value - \ set the space between two text lines + set the space between two text lines \-interpolate method pixel color interpolation method \-interword-spacing value - \ set the space between two words + set the space between two words \-kerning value set the space between two letters \-label string assign a label to an image \-limit type value pixel cache resource limit @@ -133,7 +133,7 @@ Image Operators: \-blur geometry reduce image noise and reduce detail levels \-border geometry surround image with a border of color \-brightness-contrast geometry - \ improve brightness / contrast of the image + improve brightness / contrast of the image \-canny geometry detect edges in the image \-channel mask set the image channel mask \-charcoal radius simulate a charcoal drawing @@ -155,7 +155,7 @@ Image Operators: \-deskew threshold straighten an image \-despeckle reduce the speckles within an image \-distort method args - \ distort images according to given method ad args + distort images according to given method and args \-draw string annotate the image with a graphic primitive \-edge radius apply a filter to detect edges in the image \-emboss radius emboss an image @@ -186,7 +186,7 @@ Image Operators: \-layers method optimize or compare image layers \-level value adjust the level of image contrast \-level-colors color,color - \ level image with the given colors + level image with the given colors \-linear-stretch geometry improve contrast by `stretching with saturation' the intensity range \-liquid-rescale geometry @@ -243,7 +243,7 @@ Image Operators: \-sketch geometry simulate a pencil sketch \-solarize threshold negate all pixels above the threshold level \-sparse-color method args - \ fill in a image based on a few color points + fill in a image based on a few color points \-splice geometry splice the background color into the image \-spread amount displace image pixels by a random amount \-strip strip image of all profiles and comments diff --git a/utilities/display.1.in b/utilities/display.1.in index 0b27c8fb9..f627e86ca 100644 --- a/utilities/display.1.in +++ b/utilities/display.1.in @@ -11,7 +11,7 @@ For more information about the display command, point your browser to file://@DO .SH DESCRIPTION Image Settings: \-alpha option on, activate, off, deactivate, set, opaque, copy - \ transparent, extract, background, or shape + transparent, extract, background, or shape \-antialias remove pixel-aliasing \-authenticate value decrypt image with this password \-backdrop display image centered on a backdrop diff --git a/utilities/mogrify.1.in b/utilities/mogrify.1.in index 7dbfc39d6..7cd9ad85b 100644 --- a/utilities/mogrify.1.in +++ b/utilities/mogrify.1.in @@ -153,7 +153,7 @@ Image Operators: \-deskew threshold straighten an image \-despeckle reduce the speckles within an image \-distort method args - distort images according to given method ad args + distort images according to given method and args \-draw string annotate the image with a graphic primitive \-edge radius apply a filter to detect edges in the image \-emboss radius emboss an image diff --git a/utilities/montage.1.in b/utilities/montage.1.in index e9ad7ce6e..0a82b7304 100644 --- a/utilities/montage.1.in +++ b/utilities/montage.1.in @@ -13,7 +13,7 @@ Image Settings: \-adjoin join images into a single multi-image file \-affine matrix affine transform matrix \-alpha option on, activate, off, deactivate, set, opaque, copy - \ transparent, extract, background, or shape + transparent, extract, background, or shape \-authenticate value decrypt image with this password \-blue-primary point chromaticity blue primary point \-bordercolor color border color -- 2.40.0