From: Cristy Date: Thu, 16 Feb 2017 12:29:19 +0000 (-0500) Subject: Must support -mattecolor option for IMv6 compatibility. X-Git-Tag: 7.0.4-10~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18b2750bbc8a044f6c98a058f4e962b1616c53ca;p=imagemagick Must support -mattecolor option for IMv6 compatibility. --- diff --git a/ChangeLog b/ChangeLog index b9ea93c09..5e33e4a83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2017-02-15 7.0.4-10 Cristy * Prevent random pixel data for corrupt JPEG image (bug report from Hirokazu Moriguchi, Sony). + * Restore -mattecolor option. 2017-02-14 7.0.4-9 Cristy * Release ImageMagick version 7.0.4-9, GIT revision 19580:d474b37:20170214. diff --git a/MagickCore/decorate.c b/MagickCore/decorate.c index 36853e979..9e1f86077 100644 --- a/MagickCore/decorate.c +++ b/MagickCore/decorate.c @@ -125,11 +125,11 @@ MagickExport Image *BorderImage(const Image *image, clone_image=CloneImage(image,0,0,MagickTrue,exception); if (clone_image == (Image *) NULL) return((Image *) NULL); - clone_image->alpha_color=image->border_color; + clone_image->matte_color=image->border_color; border_image=FrameImage(clone_image,&frame_info,compose,exception); clone_image=DestroyImage(clone_image); if (border_image != (Image *) NULL) - border_image->alpha_color=image->alpha_color; + border_image->matte_color=image->matte_color; return(border_image); } @@ -145,7 +145,7 @@ MagickExport Image *BorderImage(const Image *image, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % FrameImage() adds a simulated three-dimensional border around the image. -% The color of the border is defined by the alpha_color member of image. +% The color of the border is defined by the matte_color member of image. % Members width and height of frame_info specify the border width of the % vertical and horizontal sides of the frame. Members inner and outer % indicate the width of the inner and outer shadows of the frame. @@ -232,7 +232,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, if ((IsPixelInfoGray(&frame_image->border_color) == MagickFalse) && (IsGrayColorspace(frame_image->colorspace) != MagickFalse)) (void) SetImageColorspace(frame_image,sRGBColorspace,exception); - if ((frame_image->alpha_color.alpha_trait != UndefinedPixelTrait) && + if ((frame_image->matte_color.alpha_trait != UndefinedPixelTrait) && (frame_image->alpha_trait == UndefinedPixelTrait)) (void) SetImageAlpha(frame_image,OpaqueAlpha,exception); frame_image->page=image->page; @@ -244,7 +244,7 @@ MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info, /* Initialize 3D effects color. */ - matte=image->alpha_color; + matte=image->matte_color; accentuate=matte; accentuate.red=(double) (QuantumScale*((QuantumRange- AccentuateModulate)*matte.red+(QuantumRange*AccentuateModulate))); diff --git a/MagickCore/display.c b/MagickCore/display.c index 8f77bc528..b1d445ba0 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -8917,7 +8917,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, exception); XSetCursorState(display,windows,MagickTrue); XCheckRefreshWindows(display,windows); - (void) QueryColorCompliance(color,AllCompliance,&(*image)->alpha_color, + (void) QueryColorCompliance(color,AllCompliance,&(*image)->matte_color, exception); (void) ParsePageGeometry(*image,geometry,&page_geometry, exception); diff --git a/MagickCore/distort.c b/MagickCore/distort.c index 624c3ff76..f7dd04d54 100644 --- a/MagickCore/distort.c +++ b/MagickCore/distort.c @@ -2367,13 +2367,13 @@ MagickExport Image *DistortImage(const Image *image, DistortMethod method, } /* Initialize default pixel validity - * negative: pixel is invalid output 'alpha_color' + * negative: pixel is invalid output 'matte_color' * 0.0 to 1.0: antialiased, mix with resample output * 1.0 or greater: use resampled output. */ validity = 1.0; - ConformPixelInfo(distort_image,&distort_image->alpha_color,&invalid, + ConformPixelInfo(distort_image,&distort_image->matte_color,&invalid, exception); for (i=0; i < (ssize_t) distort_image->columns; i++) { diff --git a/MagickCore/effect.c b/MagickCore/effect.c index 7a0c94c02..8fdcda64d 100644 --- a/MagickCore/effect.c +++ b/MagickCore/effect.c @@ -2323,7 +2323,7 @@ MagickExport Image *PreviewImage(const Image *image,const PreviewType preview, if (i == (NumberTiles/2)) { (void) QueryColorCompliance("#dfdfdf",AllCompliance, - &thumbnail->alpha_color,exception); + &thumbnail->matte_color,exception); AppendImageToList(&images,thumbnail); continue; } diff --git a/MagickCore/identify.c b/MagickCore/identify.c index 20c83bda3..076c37d3f 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -1155,9 +1155,9 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, (void) FormatLocaleFile(file," Tile geometry: %.20gx%.20g%+.20g%+.20g\n", (double) image->extract_info.width,(double) image->extract_info.height, (double) image->extract_info.x,(double) image->extract_info.y); - (void) QueryColorname(image,&image->alpha_color,SVGCompliance,color, + (void) QueryColorname(image,&image->matte_color,SVGCompliance,color, exception); - (void) FormatLocaleFile(file," Alpha color: %s\n",color); + (void) FormatLocaleFile(file," Matte color: %s\n",color); (void) QueryColorname(image,&image->background_color,SVGCompliance,color, exception); (void) FormatLocaleFile(file," Background color: %s\n",color); diff --git a/MagickCore/image.c b/MagickCore/image.c index 30bf4b85d..bfee8a4fb 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -105,7 +105,6 @@ Constant declaration. */ const char - AlphaColor[] = "#bdbdbd", /* gray */ BackgroundColor[] = "#ffffff", /* white */ BorderColor[] = "#dfdfdf", /* gray */ DefaultTileFrame[] = "15x15+3+3", @@ -114,6 +113,7 @@ const char ForegroundColor[] = "#000", /* black */ LoadImageTag[] = "Load/Image", LoadImagesTag[] = "Load/Images", + MatteColor[] = "#bdbdbd", /* gray */ PSDensityGeometry[] = "72.0x72.0", PSPageGeometry[] = "612x792", SaveImageTag[] = "Save/Image", @@ -194,7 +194,7 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info, image->interlace=NoInterlace; image->ticks_per_second=UndefinedTicksPerSecond; image->compose=OverCompositeOp; - (void) QueryColorCompliance(AlphaColor,AllCompliance,&image->alpha_color, + (void) QueryColorCompliance(MatteColor,AllCompliance,&image->matte_color, exception); (void) QueryColorCompliance(BackgroundColor,AllCompliance, &image->background_color,exception); @@ -275,7 +275,7 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info, if (image_info->depth != 0) image->depth=image_info->depth; image->dither=image_info->dither; - image->alpha_color=image_info->alpha_color; + image->matte_color=image_info->matte_color; image->background_color=image_info->background_color; image->border_color=image_info->border_color; image->transparent_color=image_info->transparent_color; @@ -974,7 +974,7 @@ MagickExport ImageInfo *CloneImageInfo(const ImageInfo *image_info) (void) CloneString(&clone_info->density,image_info->density); clone_info->pointsize=image_info->pointsize; clone_info->fuzz=image_info->fuzz; - clone_info->alpha_color=image_info->alpha_color; + clone_info->matte_color=image_info->matte_color; clone_info->background_color=image_info->background_color; clone_info->border_color=image_info->border_color; clone_info->transparent_color=image_info->transparent_color; @@ -1365,12 +1365,12 @@ MagickExport void GetImageInfo(ImageInfo *image_info) synchronize=DestroyString(synchronize); } exception=AcquireExceptionInfo(); - (void) QueryColorCompliance(AlphaColor,AllCompliance,&image_info->alpha_color, - exception); (void) QueryColorCompliance(BackgroundColor,AllCompliance, &image_info->background_color,exception); (void) QueryColorCompliance(BorderColor,AllCompliance, &image_info->border_color,exception); + (void) QueryColorCompliance(MatteColor,AllCompliance,&image_info->matte_color, + exception); (void) QueryColorCompliance(TransparentColor,AllCompliance, &image_info->transparent_color,exception); exception=DestroyExceptionInfo(exception); @@ -3844,10 +3844,6 @@ MagickExport MagickBooleanType SyncImageSettings(const ImageInfo *image_info, assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - option=GetImageOption(image_info,"alpha-color"); - if (option != (const char *) NULL) - (void) QueryColorCompliance(option,AllCompliance,&image->alpha_color, - exception); option=GetImageOption(image_info,"background"); if (option != (const char *) NULL) (void) QueryColorCompliance(option,AllCompliance,&image->background_color, @@ -3938,6 +3934,10 @@ MagickExport MagickBooleanType SyncImageSettings(const ImageInfo *image_info, option=GetImageOption(image_info,"loop"); if (option != (const char *) NULL) image->iterations=StringToUnsignedLong(option); + option=GetImageOption(image_info,"mattecolor"); + if (option != (const char *) NULL) + (void) QueryColorCompliance(option,AllCompliance,&image->matte_color, + exception); option=GetImageOption(image_info,"orient"); if (option != (const char *) NULL) image->orientation=(OrientationType) ParseCommandOption( diff --git a/MagickCore/image.h b/MagickCore/image.h index e9b28ed06..1ade6ebb1 100644 --- a/MagickCore/image.h +++ b/MagickCore/image.h @@ -177,7 +177,7 @@ struct _Image PixelInfo *colormap, - alpha_color, /* current alphacolor attribute */ + alpha_color, /* deprecated */ background_color, /* current background color attribute */ border_color, /* current bordercolor attribute */ transparent_color; /* color for 'transparent' color index in GIF */ @@ -352,6 +352,9 @@ struct _Image size_t signature; + + PixelInfo + matte_color; /* current mattecolor attribute */ }; /* @@ -409,7 +412,7 @@ struct _ImageInfo fuzz; /* current color fuzz attribute */ PixelInfo - alpha_color, /* alpha (frame) color */ + alpha_color, /* deprecated */ background_color, /* user set background color */ border_color, /* user set border color */ transparent_color; /* color for transparent index in color tables */ @@ -477,6 +480,9 @@ struct _ImageInfo CustomStreamInfo *custom_stream; + + PixelInfo + matte_color; /* matte (frame) color */ }; extern MagickExport ChannelType diff --git a/MagickCore/montage.c b/MagickCore/montage.c index e85375041..325939a43 100644 --- a/MagickCore/montage.c +++ b/MagickCore/montage.c @@ -129,7 +129,7 @@ MagickExport MontageInfo *CloneMontageInfo(const ImageInfo *image_info, clone_info->shadow=montage_info->shadow; clone_info->fill=montage_info->fill; clone_info->stroke=montage_info->stroke; - clone_info->alpha_color=montage_info->alpha_color; + clone_info->matte_color=montage_info->matte_color; clone_info->background_color=montage_info->background_color; clone_info->border_color=montage_info->border_color; clone_info->gravity=montage_info->gravity; @@ -231,7 +231,7 @@ MagickExport void GetMontageInfo(const ImageInfo *image_info, montage_info->pointsize=image_info->pointsize; montage_info->fill.alpha=OpaqueAlpha; montage_info->stroke.alpha=(Quantum) TransparentAlpha; - montage_info->alpha_color=image_info->alpha_color; + montage_info->matte_color=image_info->matte_color; montage_info->background_color=image_info->background_color; montage_info->border_color=image_info->border_color; montage_info->debug=IsEventLogging(); diff --git a/MagickCore/montage.h b/MagickCore/montage.h index 6702be656..54e92c64d 100644 --- a/MagickCore/montage.h +++ b/MagickCore/montage.h @@ -50,7 +50,7 @@ typedef struct _MontageInfo shadow; PixelInfo - alpha_color, + alpha_color, /* deprecated */ background_color, border_color, fill, @@ -67,6 +67,9 @@ typedef struct _MontageInfo size_t signature; + + PixelInfo + matte_color; } MontageInfo; extern MagickExport Image diff --git a/MagickCore/option.c b/MagickCore/option.c index b3a9645c5..e7c7d728d 100644 --- a/MagickCore/option.c +++ b/MagickCore/option.c @@ -308,8 +308,8 @@ static const OptionInfo { "-affine", 1L, ReplacedOptionFlag | DrawInfoOptionFlag, MagickTrue }, { "+affinity", 0L, DeprecateOptionFlag, MagickTrue }, { "-affinity", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue }, - { "+alpha-color", 0L, ImageInfoOptionFlag, MagickFalse }, - { "-alpha-color", 1L, ImageInfoOptionFlag, MagickFalse }, + { "+mattecolor", 0L, ImageInfoOptionFlag, MagickFalse }, + { "-mattecolor", 1L, ImageInfoOptionFlag, MagickFalse }, { "+annotate", 0L, DeprecateOptionFlag, MagickTrue }, { "-annotate", 2L, SimpleOperatorFlag | AlwaysInterpretArgsFlag, MagickFalse }, { "-antialias", 0L, ImageInfoOptionFlag | DrawInfoOptionFlag, MagickFalse }, diff --git a/MagickCore/property.c b/MagickCore/property.c index 3351fe7a5..8bb7088be 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -150,7 +150,7 @@ MagickExport MagickBooleanType CloneImageProperties(Image *image, image->compression=clone_image->compression; image->quality=clone_image->quality; image->depth=clone_image->depth; - image->alpha_color=clone_image->alpha_color; + image->matte_color=clone_image->matte_color; image->background_color=clone_image->background_color; image->border_color=clone_image->border_color; image->transparent_color=clone_image->transparent_color; diff --git a/MagickCore/widget.c b/MagickCore/widget.c index 49c81e9a4..254af648a 100644 --- a/MagickCore/widget.c +++ b/MagickCore/widget.c @@ -1504,7 +1504,7 @@ static void XSetMatteColor(Display *display,const XWindowInfo *window_info, else if (raised) (void) XSetForeground(display,window_info->widget_context, - window_info->pixel_info->alpha_color.pixel); + window_info->pixel_info->matte_color.pixel); else (void) XSetForeground(display,window_info->widget_context, window_info->pixel_info->depth_color.pixel); @@ -1560,7 +1560,7 @@ static void XSetTextColor(Display *display,const XWindowInfo *window_info, } foreground=(ssize_t) XPixelIntensity( &window_info->pixel_info->foreground_color); - matte=(ssize_t) XPixelIntensity(&window_info->pixel_info->alpha_color); + matte=(ssize_t) XPixelIntensity(&window_info->pixel_info->matte_color); if (MagickAbsoluteValue((int) (foreground-matte)) > (65535L >> 3)) (void) XSetForeground(display,window_info->widget_context, window_info->pixel_info->foreground_color.pixel); @@ -2084,19 +2084,19 @@ MagickPrivate void XColorBrowserWidget(Display *display,XWindows *windows, /* Display the selected color in a drawing area. */ - color=windows->widget.pixel_info->alpha_color; + color=windows->widget.pixel_info->matte_color; (void) XParseColor(display,windows->widget.map_info->colormap, - reply_info.text,&windows->widget.pixel_info->alpha_color); + reply_info.text,&windows->widget.pixel_info->matte_color); XBestPixel(display,windows->widget.map_info->colormap,(XColor *) NULL, (unsigned int) windows->widget.visual_info->colormap_size, - &windows->widget.pixel_info->alpha_color); + &windows->widget.pixel_info->matte_color); mode_info.text=colorname; - (void) FormatLocaleString(mode_info.text,MagickPathExtent,"#%02x%02x%02x", - windows->widget.pixel_info->alpha_color.red, - windows->widget.pixel_info->alpha_color.green, - windows->widget.pixel_info->alpha_color.blue); + (void) FormatLocaleString(mode_info.text,MagickPathExtent, + "#%02x%02x%02x",windows->widget.pixel_info->matte_color.red, + windows->widget.pixel_info->matte_color.green, + windows->widget.pixel_info->matte_color.blue); XDrawBeveledButton(display,&windows->widget,&mode_info); - windows->widget.pixel_info->alpha_color=color; + windows->widget.pixel_info->matte_color=color; state&=(~RedrawActionState); } /* diff --git a/MagickCore/xwindow-private.h b/MagickCore/xwindow-private.h index a1d8f6416..c89064da7 100644 --- a/MagickCore/xwindow-private.h +++ b/MagickCore/xwindow-private.h @@ -198,7 +198,7 @@ typedef struct _XPixelInfo *pixels; XColor - alpha_color, + alpha_color, /* deprecated */ foreground_color, background_color, border_color, @@ -218,6 +218,9 @@ typedef struct _XPixelInfo unsigned short box_index, pen_index; + + XColor + matte_color; } XPixelInfo; typedef struct _XResourceInfo @@ -282,7 +285,7 @@ typedef struct _XResourceInfo *image_geometry; char - *alpha_color, + *alpha_color, /* deprecated */ *map_type, *name; @@ -324,6 +327,9 @@ typedef struct _XResourceInfo char home_directory[MagickPathExtent]; + + char + *matte_color; } XResourceInfo; typedef struct _XWindowInfo diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index 16b452a5f..745529944 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -3109,31 +3109,31 @@ MagickPrivate void XGetPixelInfo(Display *display, /* Set matte color. */ - pixel->alpha_color=pixel->background_color; - if (resource_info->alpha_color != (char *) NULL) + pixel->matte_color=pixel->background_color; + if (resource_info->matte_color != (char *) NULL) { /* Matte color is specified as a X resource or command line argument. */ - status=XParseColor(display,colormap,resource_info->alpha_color, - &pixel->alpha_color); + status=XParseColor(display,colormap,resource_info->matte_color, + &pixel->matte_color); if (status == False) ThrowXWindowException(XServerError,"ColorIsNotKnownToServer", - resource_info->alpha_color); - pixel->alpha_color.pixel=XStandardPixel(map_info,&pixel->alpha_color); - pixel->alpha_color.flags=(char) (DoRed | DoGreen | DoBlue); + resource_info->matte_color); + pixel->matte_color.pixel=XStandardPixel(map_info,&pixel->matte_color); + pixel->matte_color.flags=(char) (DoRed | DoGreen | DoBlue); } /* Set highlight color. */ pixel->highlight_color.red=(unsigned short) (((double) - pixel->alpha_color.red*ScaleQuantumToShort(HighlightModulate))/65535L+ + pixel->matte_color.red*ScaleQuantumToShort(HighlightModulate))/65535L+ (ScaleQuantumToShort((Quantum) (QuantumRange-HighlightModulate)))); pixel->highlight_color.green=(unsigned short) (((double) - pixel->alpha_color.green*ScaleQuantumToShort(HighlightModulate))/65535L+ + pixel->matte_color.green*ScaleQuantumToShort(HighlightModulate))/65535L+ (ScaleQuantumToShort((Quantum) (QuantumRange-HighlightModulate)))); pixel->highlight_color.blue=(unsigned short) (((double) - pixel->alpha_color.blue*ScaleQuantumToShort(HighlightModulate))/65535L+ + pixel->matte_color.blue*ScaleQuantumToShort(HighlightModulate))/65535L+ (ScaleQuantumToShort((Quantum) (QuantumRange-HighlightModulate)))); pixel->highlight_color.pixel=XStandardPixel(map_info,&pixel->highlight_color); pixel->highlight_color.flags=(char) (DoRed | DoGreen | DoBlue); @@ -3141,33 +3141,33 @@ MagickPrivate void XGetPixelInfo(Display *display, Set shadow color. */ pixel->shadow_color.red=(unsigned short) (((double) - pixel->alpha_color.red*ScaleQuantumToShort(ShadowModulate))/65535L); + pixel->matte_color.red*ScaleQuantumToShort(ShadowModulate))/65535L); pixel->shadow_color.green=(unsigned short) (((double) - pixel->alpha_color.green*ScaleQuantumToShort(ShadowModulate))/65535L); + pixel->matte_color.green*ScaleQuantumToShort(ShadowModulate))/65535L); pixel->shadow_color.blue=(unsigned short) (((double) - pixel->alpha_color.blue*ScaleQuantumToShort(ShadowModulate))/65535L); + pixel->matte_color.blue*ScaleQuantumToShort(ShadowModulate))/65535L); pixel->shadow_color.pixel=XStandardPixel(map_info,&pixel->shadow_color); pixel->shadow_color.flags=(char) (DoRed | DoGreen | DoBlue); /* Set depth color. */ pixel->depth_color.red=(unsigned short) (((double) - pixel->alpha_color.red*ScaleQuantumToShort(DepthModulate))/65535L); + pixel->matte_color.red*ScaleQuantumToShort(DepthModulate))/65535L); pixel->depth_color.green=(unsigned short) (((double) - pixel->alpha_color.green*ScaleQuantumToShort(DepthModulate))/65535L); + pixel->matte_color.green*ScaleQuantumToShort(DepthModulate))/65535L); pixel->depth_color.blue=(unsigned short) (((double) - pixel->alpha_color.blue*ScaleQuantumToShort(DepthModulate))/65535L); + pixel->matte_color.blue*ScaleQuantumToShort(DepthModulate))/65535L); pixel->depth_color.pixel=XStandardPixel(map_info,&pixel->depth_color); pixel->depth_color.flags=(char) (DoRed | DoGreen | DoBlue); /* Set trough color. */ pixel->trough_color.red=(unsigned short) (((double) - pixel->alpha_color.red*ScaleQuantumToShort(TroughModulate))/65535L); + pixel->matte_color.red*ScaleQuantumToShort(TroughModulate))/65535L); pixel->trough_color.green=(unsigned short) (((double) - pixel->alpha_color.green*ScaleQuantumToShort(TroughModulate))/65535L); + pixel->matte_color.green*ScaleQuantumToShort(TroughModulate))/65535L); pixel->trough_color.blue=(unsigned short) (((double) - pixel->alpha_color.blue*ScaleQuantumToShort(TroughModulate))/65535L); + pixel->matte_color.blue*ScaleQuantumToShort(TroughModulate))/65535L); pixel->trough_color.pixel=XStandardPixel(map_info,&pixel->trough_color); pixel->trough_color.flags=(char) (DoRed | DoGreen | DoBlue); /* @@ -3480,8 +3480,6 @@ MagickExport void XGetResourceInfo(const ImageInfo *image_info, resource_info->quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL); resource_info->close_server=MagickTrue; resource_info->client_name=AcquireString(client_name); - resource_info->alpha_color=XGetResourceInstance(database,client_name, - "alpha-color",(char *) NULL); resource_value=XGetResourceClass(database,client_name,"backdrop", (char *) "False"); resource_info->backdrop=IsStringTrue(resource_value); @@ -3572,6 +3570,8 @@ MagickExport void XGetResourceInfo(const ImageInfo *image_info, resource_info->magnify=(unsigned int) StringToUnsignedLong(resource_value); resource_info->map_type=XGetResourceClass(database,client_name,"map", (char *) NULL); + resource_info->matte_color=XGetResourceInstance(database,client_name, + "mattecolor",(char *) NULL); resource_info->name=ConstantString(XGetResourceClass(database,client_name, "name",(char *) NULL)); resource_info->pen_colors[0]=XGetResourceClass(database,client_name,"pen1", @@ -7921,7 +7921,7 @@ MagickPrivate void XMakeStandardColormap(Display *display, (void) XAllocColor(display,colormap,&pixel->foreground_color); (void) XAllocColor(display,colormap,&pixel->background_color); (void) XAllocColor(display,colormap,&pixel->border_color); - (void) XAllocColor(display,colormap,&pixel->alpha_color); + (void) XAllocColor(display,colormap,&pixel->matte_color); (void) XAllocColor(display,colormap,&pixel->highlight_color); (void) XAllocColor(display,colormap,&pixel->shadow_color); (void) XAllocColor(display,colormap,&pixel->depth_color); @@ -8256,7 +8256,7 @@ MagickPrivate void XMakeStandardColormap(Display *display, XBestPixel(display,colormap,colors,(unsigned int) number_colors, &pixel->border_color); XBestPixel(display,colormap,colors,(unsigned int) number_colors, - &pixel->alpha_color); + &pixel->matte_color); XBestPixel(display,colormap,colors,(unsigned int) number_colors, &pixel->highlight_color); XBestPixel(display,colormap,colors,(unsigned int) number_colors, diff --git a/MagickWand/animate.c b/MagickWand/animate.c index 296e866bc..fbfe5b5a8 100644 --- a/MagickWand/animate.c +++ b/MagickWand/animate.c @@ -209,7 +209,7 @@ static MagickBooleanType AnimateUsage(void) (void) printf( "resources as command line options: -background, -bordercolor,\n"); (void) printf( - "-alpha-color, -borderwidth, -font, -foreground, -iconGeometry,\n"); + "-mattecolor, -borderwidth, -font, -foreground, -iconGeometry,\n"); (void) printf("-iconic, -name, -shared-memory, or -title.\n"); (void) printf( "\nBy default, the image format of 'file' is determined by its magic\n"); @@ -468,16 +468,6 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, "UnrecognizedAlphaChannelOption",argv[i]); break; } - if (LocaleCompare("alpha-color",option+1) == 0) - { - if (*option == '+') - break; - i++; - if (i == (ssize_t) argc) - ThrowAnimateException(OptionError,"MissingArgument",option); - resource_info.alpha_color=argv[i]; - break; - } if (LocaleCompare("authenticate",option+1) == 0) { if (*option == '+') @@ -1063,6 +1053,16 @@ WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, } if (LocaleCompare("matte",option+1) == 0) break; + if (LocaleCompare("mattecolor",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t) argc) + ThrowAnimateException(OptionError,"MissingArgument",option); + resource_info.matte_color=argv[i]; + break; + } if (LocaleCompare("monitor",option+1) == 0) break; if (LocaleCompare("monochrome",option+1) == 0) diff --git a/MagickWand/convert.c b/MagickWand/convert.c index 52c818836..d0c7aaf8f 100644 --- a/MagickWand/convert.c +++ b/MagickWand/convert.c @@ -363,7 +363,6 @@ static MagickBooleanType ConvertUsage(void) "-adjoin join images into a single multi-image file", "-affine matrix affine transform matrix", "-alpha option activate, deactivate, reset, or set the alpha channel", - "-alpha-color color frame color", "-antialias remove pixel-aliasing", "-authenticate password", " decipher image with this password", @@ -416,6 +415,7 @@ static MagickBooleanType ConvertUsage(void) "-limit type value pixel cache resource limit", "-loop iterations add Netscape loop extension to your GIF animation", "-matte store matte channel if the image has one", + "-mattecolor color frame color", "-moments report image moments", "-monitor monitor progress", "-orient type image orientation", @@ -706,15 +706,6 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info, "UnrecognizedAlphaChannelOption",argv[i]); break; } - if (LocaleCompare("alpha-color", option + 1) == 0) - { - if (*option == '+') - break; - i++; - if (i == (ssize_t)argc) - ThrowConvertException(OptionError, "MissingArgument", option); - break; - } if (LocaleCompare("annotate",option+1) == 0) { if (*option == '+') @@ -2120,6 +2111,15 @@ WandExport MagickBooleanType ConvertImageCommand(ImageInfo *image_info, } if (LocaleCompare("matte",option+1) == 0) break; + if (LocaleCompare("mattecolor",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t)argc) + ThrowConvertException(OptionError, "MissingArgument", option); + break; + } if (LocaleCompare("maximum",option+1) == 0) break; if (LocaleCompare("mean-shift",option+1) == 0) diff --git a/MagickWand/deprecate.c b/MagickWand/deprecate.c index a96eedbef..9a747477e 100644 --- a/MagickWand/deprecate.c +++ b/MagickWand/deprecate.c @@ -48,5 +48,80 @@ #include "MagickCore/thread-private.h" #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% M a g i c k G e t I m a g e A l p h a C o l o r % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickGetImageAlphaColor() returns the image alpha color. +% +% The format of the MagickGetImageAlphaColor method is: +% +% MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand, +% PixelWand *alpha_color) +% +% A description of each parameter follows: +% +% o wand: the magick wand. +% +% o alpha_color: return the alpha color. +% +*/ +WandExport MagickBooleanType MagickGetImageAlphaColor(MagickWand *wand, + PixelWand *alpha_color) +{ + assert(wand != (MagickWand *)NULL); + assert(wand->signature == MagickWandSignature); + if (wand->debug != MagickFalse) + (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *)NULL) + ThrowWandException(WandError, "ContainsNoImages", wand->name); + PixelSetPixelColor(alpha_color,&wand->images->matte_color); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% M a g i c k S e t I m a g e A l p h a C o l o r % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickSetImageAlphaColor() sets the image alpha color. +% +% The format of the MagickSetImageAlphaColor method is: +% +% MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand, +% const PixelWand *matte) +% +% A description of each parameter follows: +% +% o wand: the magick wand. +% +% o matte: the alpha pixel wand. +% +*/ +WandExport MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand, + const PixelWand *alpha) +{ + assert(wand != (MagickWand *)NULL); + assert(wand->signature == MagickWandSignature); + if (wand->debug != MagickFalse) + (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *)NULL) + ThrowWandException(WandError,"ContainsNoImages",wand->name); + PixelGetQuantumPacket(alpha,&wand->images->matte_color); + return(MagickTrue); +} #endif diff --git a/MagickWand/deprecate.h b/MagickWand/deprecate.h index c6e396b73..2fc0edfa9 100644 --- a/MagickWand/deprecate.h +++ b/MagickWand/deprecate.h @@ -22,8 +22,14 @@ extern "C" { #endif +#include "MagickWand/pixel-wand.h" + #if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +extern WandExport MagickBooleanType + MagickGetImageAlphaColor(MagickWand *,PixelWand *), + MagickSetImageAlphaColor(MagickWand *,const PixelWand *); + #endif #if defined(__cplusplus) || defined(c_plusplus) diff --git a/MagickWand/display.c b/MagickWand/display.c index 337b13375..f6fec078d 100644 --- a/MagickWand/display.c +++ b/MagickWand/display.c @@ -244,7 +244,7 @@ static MagickBooleanType DisplayUsage(void) (void) printf( "resources as command line options: -background, -bordercolor,\n"); (void) printf( - " -alpha-color, -borderwidth, -font, -foreground, -iconGeometry,\n"); + " -mattecolor, -borderwidth, -font, -foreground, -iconGeometry,\n"); (void) printf("-iconic, -name, -shared-memory, -usePixmap, or -title.\n"); (void) printf( "\nBy default, the image format of 'file' is determined by its magic\n"); @@ -1381,14 +1381,14 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, } if (LocaleCompare("matte",option+1) == 0) break; - if (LocaleCompare("alpha-color",option+1) == 0) + if (LocaleCompare("mattecolor",option+1) == 0) { if (*option == '+') break; i++; if (i == (ssize_t) argc) ThrowDisplayException(OptionError,"MissingArgument",option); - resource_info.alpha_color=argv[i]; + resource_info.matte_color=argv[i]; break; } if (LocaleCompare("monitor",option+1) == 0) diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 3bb95759d..0a4eb385c 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -3386,7 +3386,7 @@ WandExport MagickBooleanType MagickForwardFourierTransformImage( % The format of the MagickFrameImage method is: % % MagickBooleanType MagickFrameImage(MagickWand *wand, -% const PixelWand *alpha_color,const size_t width, +% const PixelWand *matte_color,const size_t width, % const size_t height,const ssize_t inner_bevel, % const ssize_t outer_bevel,const CompositeOperator compose) % @@ -3394,7 +3394,7 @@ WandExport MagickBooleanType MagickForwardFourierTransformImage( % % o wand: the magick wand. % -% o alpha_color: the frame color pixel wand. +% o matte_color: the frame color pixel wand. % % o width: the border width. % @@ -3408,7 +3408,7 @@ WandExport MagickBooleanType MagickForwardFourierTransformImage( % */ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand, - const PixelWand *alpha_color,const size_t width,const size_t height, + const PixelWand *matte_color,const size_t width,const size_t height, const ssize_t inner_bevel,const ssize_t outer_bevel, const CompositeOperator compose) { @@ -3431,7 +3431,7 @@ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand, frame_info.y=(ssize_t) height; frame_info.inner_bevel=inner_bevel; frame_info.outer_bevel=outer_bevel; - PixelGetQuantumPacket(alpha_color,&wand->images->alpha_color); + PixelGetQuantumPacket(matte_color,&wand->images->matte_color); frame_image=FrameImage(wand->images,&frame_info,compose,wand->exception); if (frame_image == (Image *) NULL) return(MagickFalse); @@ -3705,44 +3705,6 @@ WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(GetImageAlphaChannel(wand->images)); } - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% M a g i c k G e t I m a g e A l p h a C o l o r % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% MagickGetImageAlhpaColor() returns the image alpha color. -% -% The format of the MagickGetImageAlhpaColor method is: -% -% MagickBooleanType MagickGetImageAlhpaColor(MagickWand *wand, -% PixelWand *alpha_color) -% -% A description of each parameter follows: -% -% o wand: the magick wand. -% -% o alpha_color: return the alpha color. -% -*/ -WandExport MagickBooleanType MagickGetImageAlhpaColor(MagickWand *wand, - PixelWand *alpha_color) -{ - assert(wand != (MagickWand *)NULL); - assert(wand->signature == MagickWandSignature); - if (wand->debug != MagickFalse) - (void) LogMagickEvent(WandEvent, GetMagickModule(), "%s", wand->name); - if (wand->images == (Image *)NULL) - ThrowWandException(WandError, "ContainsNoImages", wand->name); - PixelSetPixelColor(alpha_color, &wand->images->alpha_color); - return(MagickTrue); -} /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -5199,6 +5161,44 @@ WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand, % % % % % % +% M a g i c k G e t I m a g e M a t t e C o l o r % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickGetImageMatteColor() returns the image matte color. +% +% The format of the MagickGetImageMatteColor method is: +% +% MagickBooleanType MagickGetImageMatteColor(MagickWand *wand, +% PixelWand *matte_color) +% +% A description of each parameter follows: +% +% o wand: the magick wand. +% +% o matte_color: return the alpha color. +% +*/ +WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand, + PixelWand *matte_color) +{ + assert(wand != (MagickWand *)NULL); + assert(wand->signature == MagickWandSignature); + if (wand->debug != MagickFalse) + (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *)NULL) + ThrowWandException(WandError, "ContainsNoImages", wand->name); + PixelSetPixelColor(matte_color,&wand->images->matte_color); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % M a g i c k G e t I m a g e O r i e n t a t i o n % % % % % @@ -9038,44 +9038,6 @@ WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand, % % % % % % -% M a g i c k S e t I m a g e A l p h a C o l o r % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% MagickSetImageAlphaColor() sets the image alpha color. -% -% The format of the MagickSetImageAlphaColor method is: -% -% MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand, -% const PixelWand *matte) -% -% A description of each parameter follows: -% -% o wand: the magick wand. -% -% o matte: the alpha pixel wand. -% -*/ -WandExport MagickBooleanType MagickSetImageAlphaColor(MagickWand *wand, - const PixelWand *alpha) -{ - assert(wand != (MagickWand *)NULL); - assert(wand->signature == MagickWandSignature); - if (wand->debug != MagickFalse) - (void) LogMagickEvent(WandEvent, GetMagickModule(), "%s", wand->name); - if (wand->images == (Image *)NULL) - ThrowWandException(WandError, "ContainsNoImages", wand->name); - PixelGetQuantumPacket(alpha, &wand->images->alpha_color); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % M a g i c k S e t I m a g e B a c k g r o u n d C o l o r % % % % % @@ -10127,6 +10089,44 @@ WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand, % % % % % % +% M a g i c k S e t I m a g e M a t t e C o l o r % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickSetImageMatteColor() sets the image alpha color. +% +% The format of the MagickSetImageMatteColor method is: +% +% MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, +% const PixelWand *matte) +% +% A description of each parameter follows: +% +% o wand: the magick wand. +% +% o matte: the alpha pixel wand. +% +*/ +WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, + const PixelWand *alpha) +{ + assert(wand != (MagickWand *)NULL); + assert(wand->signature == MagickWandSignature); + if (wand->debug != MagickFalse) + (void) LogMagickEvent(WandEvent, GetMagickModule(), "%s", wand->name); + if (wand->images == (Image *)NULL) + ThrowWandException(WandError, "ContainsNoImages", wand->name); + PixelGetQuantumPacket(alpha,&wand->images->matte_color); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % M a g i c k S e t I m a g e O p a c i t y % % % % % diff --git a/MagickWand/magick-image.h b/MagickWand/magick-image.h index bd31241bb..e61bf8d62 100644 --- a/MagickWand/magick-image.h +++ b/MagickWand/magick-image.h @@ -111,8 +111,8 @@ extern WandExport MagickBooleanType MagickCommentImage(MagickWand *,const char *), MagickCompositeImage(MagickWand *,const MagickWand *,const CompositeOperator, const MagickBooleanType,const ssize_t,const ssize_t), - MagickCompositeImageGravity(MagickWand *,const MagickWand *,const CompositeOperator, - const GravityType), + MagickCompositeImageGravity(MagickWand *,const MagickWand *, + const CompositeOperator,const GravityType), MagickCompositeLayers(MagickWand *,const MagickWand *,const CompositeOperator, const ssize_t,const ssize_t), MagickConstituteImage(MagickWand *,const size_t,const size_t,const char *, @@ -153,7 +153,6 @@ extern WandExport MagickBooleanType MagickGammaImage(MagickWand *,const double), MagickGaussianBlurImage(MagickWand *,const double,const double), MagickGetImageAlphaChannel(MagickWand *), - MagickGetImageAlphaColor(MagickWand *,PixelWand *), MagickGetImageBackgroundColor(MagickWand *,PixelWand *), MagickGetImageBluePrimary(MagickWand *,double *,double *,double *), MagickGetImageBorderColor(MagickWand *,PixelWand *), @@ -165,6 +164,7 @@ extern WandExport MagickBooleanType double *), MagickGetImageGreenPrimary(MagickWand *,double *,double *,double *), MagickGetImageLength(MagickWand *,MagickSizeType *), + MagickGetImageMatteColor(MagickWand *,PixelWand *), MagickGetImagePage(MagickWand *,size_t *,size_t *,ssize_t *, ssize_t *), MagickGetImagePixelColor(MagickWand *,const ssize_t,const ssize_t, @@ -245,7 +245,6 @@ extern WandExport MagickBooleanType MagickSetImage(MagickWand *,const MagickWand *), MagickSetImageAlpha(MagickWand *,const double), MagickSetImageAlphaChannel(MagickWand *,const AlphaChannelOption), - MagickSetImageAlphaColor(MagickWand *,const PixelWand *), MagickSetImageBackgroundColor(MagickWand *,const PixelWand *), MagickSetImageBluePrimary(MagickWand *,const double,const double, const double), @@ -273,6 +272,7 @@ extern WandExport MagickBooleanType MagickSetImageInterpolateMethod(MagickWand *,const PixelInterpolateMethod), MagickSetImageIterations(MagickWand *,const size_t), MagickSetImageMatte(MagickWand *,const MagickBooleanType), + MagickSetImageMatteColor(MagickWand *,const PixelWand *), MagickSetImageOrientation(MagickWand *,const OrientationType), MagickSetImagePage(MagickWand *,const size_t,const size_t,const ssize_t, const ssize_t), diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 97bf3faf3..066d80bde 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -3643,7 +3643,6 @@ static MagickBooleanType MogrifyUsage(void) "-adjoin join images into a single multi-image file", "-affine matrix affine transform matrix", "-alpha option activate, deactivate, reset, or set the alpha channel", - "-alpha-color color frame color", "-antialias remove pixel-aliasing", "-authenticate password", " decipher image with this password", @@ -3693,6 +3692,7 @@ static MagickBooleanType MogrifyUsage(void) "-limit type value pixel cache resource limit", "-loop iterations add Netscape loop extension to your GIF animation", "-matte store matte channel if the image has one", + "-mattecolor color frame color", "-monitor monitor progress", "-orient type image orientation", "-page geometry size and location of an image canvas (setting)", @@ -4057,15 +4057,6 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, "UnrecognizedAlphaChannelOption",argv[i]); break; } - if (LocaleCompare("alpha-color",option+1) == 0) - { - if (*option == '+') - break; - i++; - if (i == (ssize_t) argc) - ThrowMogrifyException(OptionError,"MissingArgument",option); - break; - } if (LocaleCompare("annotate",option+1) == 0) { if (*option == '+') @@ -5382,6 +5373,15 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, } if (LocaleCompare("matte",option+1) == 0) break; + if (LocaleCompare("mattecolor",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t) argc) + ThrowMogrifyException(OptionError,"MissingArgument",option); + break; + } if (LocaleCompare("maximum",option+1) == 0) break; if (LocaleCompare("mean-shift",option+1) == 0) @@ -6581,20 +6581,6 @@ WandExport MagickBooleanType MogrifyImageInfo(ImageInfo *image_info, image_info->adjoin=(*option == '-') ? MagickTrue : MagickFalse; break; } - if (LocaleCompare("alpha-color",option+1) == 0) - { - if (*option == '+') - { - (void) SetImageOption(image_info,option+1,argv[i+1]); - (void) QueryColorCompliance(MogrifyAlphaColor,AllCompliance, - &image_info->alpha_color,exception); - break; - } - (void) SetImageOption(image_info,option+1,argv[i+1]); - (void) QueryColorCompliance(argv[i+1],AllCompliance, - &image_info->alpha_color,exception); - break; - } if (LocaleCompare("antialias",option+1) == 0) { image_info->antialias=(*option == '-') ? MagickTrue : MagickFalse; @@ -7229,6 +7215,20 @@ WandExport MagickBooleanType MogrifyImageInfo(ImageInfo *image_info, (void) SetImageOption(image_info,option+1,"true"); break; } + if (LocaleCompare("mattecolor",option+1) == 0) + { + if (*option == '+') + { + (void) SetImageOption(image_info,option+1,argv[i+1]); + (void) QueryColorCompliance(MogrifyAlphaColor,AllCompliance, + &image_info->matte_color,exception); + break; + } + (void) SetImageOption(image_info,option+1,argv[i+1]); + (void) QueryColorCompliance(argv[i+1],AllCompliance, + &image_info->matte_color,exception); + break; + } if (LocaleCompare("metric",option+1) == 0) { if (*option == '+') diff --git a/MagickWand/montage.c b/MagickWand/montage.c index be51df97d..34c7786d4 100644 --- a/MagickWand/montage.c +++ b/MagickWand/montage.c @@ -132,7 +132,6 @@ static MagickBooleanType MontageUsage(void) "-affine matrix affine transform matrix", "-alpha option on, activate, off, deactivate, set, opaque, copy", " transparent, extract, background, or shape", - "-alpha-color color frame color", "-authenticate password", " decipher image with this password", "-blue-primary point chromaticity blue primary point", @@ -169,6 +168,7 @@ static MagickBooleanType MontageUsage(void) "-label string assign a label to an image", "-limit type value pixel cache resource limit", "-matte store matte channel if the image has one", + "-mattecolor color frame color", "-mode type framing style", "-monitor monitor progress", "-page geometry size and location of an image canvas (setting)", @@ -247,7 +247,7 @@ static MagickBooleanType MontageUsage(void) (void) printf( "resources as command line options: -background, -bordercolor,\n"); (void) printf( - "-alpha-color, -borderwidth, -font, or -title\n"); + "-mattecolor, -borderwidth, -font, or -title\n"); (void) printf( "\nBy default, the image format of 'file' is determined by its magic\n"); (void) printf( @@ -466,21 +466,11 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info, i++; if (i == (ssize_t) argc) ThrowMontageException(OptionError,"MissingArgument",option); - type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]); + type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse, + argv[i]); if (type < 0) - ThrowMontageException(OptionError,"UnrecognizedAlphaChannelOption", - argv[i]); - break; - } - if (LocaleCompare("alpha-color",option+1) == 0) - { - if (*option == '+') - break; - i++; - if (i == (ssize_t) argc) - ThrowMontageException(OptionError,"MissingArgument",option); - (void) QueryColorCompliance(argv[i],AllCompliance, - &montage_info->alpha_color,exception); + ThrowMontageException(OptionError, + "UnrecognizedAlphaChannelOption",argv[i]); break; } if (LocaleCompare("annotate",option+1) == 0) @@ -1210,6 +1200,17 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info, { if (LocaleCompare("matte",option+1) == 0) break; + if (LocaleCompare("mattecolor",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t) argc) + ThrowMontageException(OptionError,"MissingArgument",option); + (void) QueryColorCompliance(argv[i],AllCompliance, + &montage_info->matte_color,exception); + break; + } if (LocaleCompare("mode",option+1) == 0) { MontageMode diff --git a/MagickWand/operation.c b/MagickWand/operation.c index e0f514b89..0ee18225c 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -486,14 +486,6 @@ WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand, GetAffineMatrix(&_draw_info->affine); break; } - if (LocaleCompare("alpha-color",option+1) == 0) - { - /* SyncImageSettings() used to set per-image attribute. */ - (void) SetImageOption(_image_info,option+1,ArgOption(NULL)); - (void) QueryColorCompliance(ArgOption(MogrifyAlphaColor),AllCompliance, - &_image_info->alpha_color,_exception); - break; - } if (LocaleCompare("antialias",option+1) == 0) { _image_info->antialias = @@ -1104,6 +1096,14 @@ WandPrivate void CLISettingOptionInfo(MagickCLI *cli_wand, } case 'm': { + if (LocaleCompare("mattecolor",option+1) == 0) + { + /* SyncImageSettings() used to set per-image attribute. */ + (void) SetImageOption(_image_info,option+1,ArgOption(NULL)); + (void) QueryColorCompliance(ArgOption(MogrifyAlphaColor), + AllCompliance,&_image_info->matte_color,_exception); + break; + } if (LocaleCompare("metric",option+1) == 0) { /* FUTURE: this is only used by CompareImages() which is used diff --git a/coders/json.c b/coders/json.c index 662138d90..9ac125204 100644 --- a/coders/json.c +++ b/coders/json.c @@ -1205,8 +1205,8 @@ static MagickBooleanType EncodeImageAttributes(Image *image,FILE *file, " \"x\": %.20g,\n \"y\": %.20g\n },\n", (double) image->extract_info.width,(double) image->extract_info.height, (double) image->extract_info.x,(double) image->extract_info.y); - GetColorTuple(&image->alpha_color,MagickTrue,color); - (void) FormatLocaleFile(file," \"alphaColor\": \"%s\",\n",color); + GetColorTuple(&image->matte_color,MagickTrue,color); + (void) FormatLocaleFile(file," \"matteColor\": \"%s\",\n",color); GetColorTuple(&image->background_color,MagickTrue,color); (void) FormatLocaleFile(file," \"backgroundColor\": \"%s\",\n",color); GetColorTuple(&image->border_color,MagickTrue,color); diff --git a/coders/miff.c b/coders/miff.c index e33eafbab..136c88ba3 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -623,12 +623,6 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, case 'a': case 'A': { - if (LocaleCompare(keyword,"alpha-color") == 0) - { - (void) QueryColorCompliance(options,AllCompliance, - &image->alpha_color,exception); - break; - } if (LocaleCompare(keyword,"alpha-trait") == 0) { ssize_t @@ -835,6 +829,12 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, BlendPixelTrait; break; } + if (LocaleCompare(keyword,"mattecolor") == 0) + { + (void) QueryColorCompliance(options,AllCompliance, + &image->matte_color,exception); + break; + } if (LocaleCompare(keyword,"montage") == 0) { (void) CloneString(&image->montage,options); diff --git a/coders/mpc.c b/coders/mpc.c index e3e8641c3..3a85d5597 100644 --- a/coders/mpc.c +++ b/coders/mpc.c @@ -339,12 +339,6 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) case 'a': case 'A': { - if (LocaleCompare(keyword,"alpha-color") == 0) - { - (void) QueryColorCompliance(options,AllCompliance, - &image->alpha_color,exception); - break; - } if (LocaleCompare(keyword,"alpha-trait") == 0) { ssize_t @@ -537,6 +531,12 @@ static Image *ReadMPCImage(const ImageInfo *image_info,ExceptionInfo *exception) signature=(unsigned int) StringToUnsignedLong(options); break; } + if (LocaleCompare(keyword,"mattecolor") == 0) + { + (void) QueryColorCompliance(options,AllCompliance, + &image->matte_color,exception); + break; + } if (LocaleCompare(keyword,"maximum-error") == 0) { image->error.normalized_maximum_error=StringToDouble( diff --git a/coders/msl.c b/coders/msl.c index f95382ff0..86d2c26e1 100644 --- a/coders/msl.c +++ b/coders/msl.c @@ -3081,7 +3081,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, if (LocaleCompare(keyword, "fill") == 0) { (void) QueryColorCompliance(value,AllCompliance, - &msl_info->image[n]->alpha_color,exception); + &msl_info->image[n]->matte_color,exception); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute", @@ -7980,12 +7980,6 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword, exception); break; } - if (LocaleCompare(keyword,"alpha-color") == 0) - { - (void) QueryColorCompliance(value,AllCompliance, - &image_info->alpha_color,exception); - break; - } if (LocaleCompare(keyword,"antialias") == 0) { ssize_t @@ -8117,6 +8111,12 @@ static MagickBooleanType SetMSLAttributes(MSLInfo *msl_info,const char *keyword, (void) CopyMagickString(image_info->magick,value,MagickPathExtent); break; } + if (LocaleCompare(keyword,"mattecolor") == 0) + { + (void) QueryColorCompliance(value,AllCompliance, + &image_info->matte_color,exception); + break; + } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); break; }