From: Cristy Date: Sat, 6 May 2017 19:50:19 +0000 (-0400) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31879 X-Git-Tag: 7.0.5-6~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d90edc602d446c70833e18e6136b06e43265164;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31879 --- diff --git a/ChangeLog b/ChangeLog index 4cd0fd9d9..0e02cba29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-05-06 7.0.5-6 Cristy + * Restore the -alpha Shape option (reference + https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31879). + 2017-04-24 7.0.5-5 Cristy * Release ImageMagick version 7.0.5-5, GIT revision 19915:12eec43:20170424. diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 10083d996..7bf76ba1d 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -1092,17 +1092,10 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, return(status); } case CopyAlphaChannel: - case ShapeAlphaChannel: { - /* - Copy pixel intensity to the alpha channel. - */ image->alpha_trait=UpdatePixelTrait; status=CompositeImage(image,image,IntensityCompositeOp,MagickTrue,0,0, exception); - if (alpha_type == ShapeAlphaChannel) - (void) LevelImageColors(image,&image->background_color, - &image->background_color,MagickTrue,exception); break; } case DeactivateAlphaChannel: @@ -1261,6 +1254,18 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, status=SetImageAlpha(image,OpaqueAlpha,exception); break; } + case ShapeAlphaChannel: + { + /* + Set alpha channel by shape. + */ + image->alpha_trait=UpdatePixelTrait; + (void) SetImageMask(image,WritePixelMask,image,exception); + (void) LevelImageColors(image,&image->background_color, + &image->background_color,MagickTrue,exception); + (void) SetImageMask(image,WritePixelMask,(Image *) NULL,exception); + break; + } case TransparentAlphaChannel: { status=SetImageAlpha(image,TransparentAlpha,exception);