125
125
"-quiet suppress all warning messages",
126
126
"-quantize colorspace reduce colors in this colorspace",
127
127
"-regard-warnings pay attention to warning messages",
128
"-respect-parenthesis settings remain in effect until parenthesis boundary",
128
"-respect-parentheses settings remain in effect until parenthesis boundary",
129
129
"-sampling-factor geometry",
130
130
" horizontal and vertical sampling factor",
131
131
"-seed value seed a new sequence of pseudo-random numbers",
184
184
#define ThrowCompareInvalidArgumentException(option,argument) \
186
186
(void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
187
"InvalidArgument","`%s': %s",argument,option); \
187
"InvalidArgument","`%s': %s",option,argument); \
188
188
DestroyCompare(); \
189
189
return(MagickFalse); \
605
612
if (i == (long) argc)
606
613
ThrowCompareException(OptionError,"MissingArgument",option);
607
(void) strtod(argv[i],&p);
614
value=strtod(argv[i],&p);
608
615
if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
609
616
ThrowCompareInvalidArgumentException(option,argv[i]);
619
if (LocaleCompare("list",option+1) == 0)
627
if (i == (long) argc)
628
ThrowCompareException(OptionError,"MissingArgument",option);
629
list=ParseMagickOption(MagickListOptions,MagickFalse,argv[i]);
631
ThrowCompareException(OptionError,"UnrecognizedListType",argv[i]);
632
(void) MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
612
637
if (LocaleCompare("log",option+1) == 0)
614
639
if (*option == '+')
834
859
ThrowCompareException(OptionError,"UnrecognizedOption",option)
836
fire=ParseMagickOption(MagickImageListOptions,MagickFalse,option+1) < 0 ?
861
fire=ParseMagickOption(MagickImageListOptions,MagickFalse,option+1) < 0 ?
837
862
MagickFalse : MagickTrue;
838
863
if (fire != MagickFalse)
839
864
FireImageStack(MagickTrue,MagickTrue,MagickTrue);
848
873
FinalizeImageSettings(image_info,image);
849
874
image=GetImageFromList(image,0);
850
875
reconstruct_image=GetImageFromList(image,1);
851
difference_image=CompareImageChannels(image,reconstruct_image,channels,
852
metric,&distortion,exception);
876
subimage=ExtractSubimageFromImage(image,reconstruct_image,exception);
877
if (subimage == (Image *) NULL)
878
difference_image=CompareImageChannels(image,reconstruct_image,channels,
879
metric,&distortion,exception);
882
difference_image=CompareImageChannels(subimage,reconstruct_image,channels,
883
metric,&distortion,exception);
884
subimage=DestroyImage(subimage);
853
886
if (difference_image == (Image *) NULL)
857
890
if (image_info->verbose != MagickFalse)
858
891
(void) IsImagesEqual(image,reconstruct_image);
892
if (*difference_image->magick == '\0')
893
(void) CopyMagickString(difference_image->magick,image->magick,
859
895
status&=WriteImages(image_info,difference_image,argv[argc-1],exception);
860
896
if ((metadata != (char **) NULL) && (format != (char *) NULL))
870
906
(void) ConcatenateString(&(*metadata),"\n");
871
907
text=DestroyString(text);
873
difference_image=DestroyImageList(difference_image);
874
909
if (image_info->verbose == MagickFalse)
877
case MeanAbsoluteErrorMetric:
878
case MeanSquaredErrorMetric:
879
case RootMeanSquaredErrorMetric:
880
case PeakAbsoluteErrorMetric:
882
(void) fprintf(stderr,"%g (%g)\n",distortion,(double) (QuantumScale*
886
case AbsoluteErrorMetric:
887
case PeakSignalToNoiseRatioMetric:
889
(void) fprintf(stderr,"%g\n",distortion);
892
case MeanErrorPerPixelMetric:
894
(void) fprintf(stderr,"%g (%g, %g)\n",distortion,
895
image->error.normalized_mean_error,
896
image->error.normalized_maximum_error);
899
case UndefinedMetric:
913
case MeanAbsoluteErrorMetric:
914
case MeanSquaredErrorMetric:
915
case RootMeanSquaredErrorMetric:
916
case PeakAbsoluteErrorMetric:
918
(void) fprintf(stderr,"%g (%g)",distortion,(double)
919
(QuantumScale*distortion));
922
case AbsoluteErrorMetric:
923
case PeakSignalToNoiseRatioMetric:
925
(void) fprintf(stderr,"%g",distortion);
928
case MeanErrorPerPixelMetric:
930
(void) fprintf(stderr,"%g (%g, %g)",distortion,
931
image->error.normalized_mean_error,
932
image->error.normalized_maximum_error);
935
case UndefinedMetric:
938
(void) fprintf(stderr," @ %ld,%ld\n",difference_image->page.x,
939
difference_image->page.y);
905
944
*channel_distortion;
908
946
channel_distortion=GetImageChannelDistortions(image,reconstruct_image,
909
947
metric,&image->exception);
910
948
(void) fprintf(stderr,"Image: %s\n",image->filename);
949
(void) fprintf(stderr,"Offset: %ld,%ld\n",difference_image->page.x,
950
difference_image->page.y);
911
951
(void) fprintf(stderr," Channel distortion: %s\n",
912
952
MagickOptionToMnemonic(MagickMetricOptions,(long) metric));