]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=31879
authorCristy <urban-warrior@imagemagick.org>
Sat, 6 May 2017 19:50:19 +0000 (15:50 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 6 May 2017 19:50:19 +0000 (15:50 -0400)
ChangeLog
MagickCore/channel.c

index 4cd0fd9d94ede000ef455b811793d1b02f953768..0e02cba29f096a9b646190bdc3a5e98850a967dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-06  7.0.5-6 Cristy  <quetzlzacatenango@image...>
+  * 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  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.5-5, GIT revision 19915:12eec43:20170424.
 
index 10083d9960c607d6ac907ee5d105588056f77b07..7bf76ba1d04bf4be445e296ab73f695760050976 100644 (file)
@@ -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);