]> granicus.if.org Git - imagemagick/commitdiff
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=33070
authorCristy <urban-warrior@imagemagick.org>
Tue, 14 Nov 2017 12:57:24 +0000 (07:57 -0500)
committerCristy <urban-warrior@imagemagick.org>
Tue, 14 Nov 2017 12:57:24 +0000 (07:57 -0500)
ChangeLog
MagickCore/fx.c

index 1532aa3b19e542e3bf6415bc94ee68c16dc7cc9b..aea5d490a98ed9a157a65891b5e1be91e5ef7807 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-11-12  7.0.7-12 Cristy  <quetzlzacatenango@image...>
+  * The -tint option no longer munges the alpha channel (reference
+    http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=33070).
+
 2017-11-11  7.0.7-11 Cristy  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.7-11, GIT revision 21635:0447c6b46:20171111.
 
index c2264b469a8cb6a8f1ffa61f8e6223cd1f66c4dc..6560cb54a8ba2f21fdc1d125eb5ea5b39fa74947 100644 (file)
@@ -5423,25 +5423,14 @@ MagickExport Image *TintImage(const Image *image,const char *blend,
       double
         weight;
 
-      register ssize_t
-        i;
-
-      for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
-      {
-        PixelChannel channel = GetPixelChannelChannel(image,i);
-        PixelTrait traits = GetPixelChannelTraits(image,channel);
-        PixelTrait tint_traits=GetPixelChannelTraits(tint_image,channel);
-        if ((traits == UndefinedPixelTrait) ||
-            (tint_traits == UndefinedPixelTrait))
-          continue;
-        if (((tint_traits & CopyPixelTrait) != 0) ||
-            (GetPixelWriteMask(image,p) <= (QuantumRange/2)))
-          {
-            SetPixelChannel(tint_image,channel,p[i],q);
-            continue;
-          }
-      }
       GetPixelInfo(image,&pixel);
+      if (GetPixelWriteMask(image,p) <= (QuantumRange/2))
+        {
+          SetPixelViaPixelInfo(tint_image,&pixel,q);
+          p+=GetPixelChannels(image);
+          q+=GetPixelChannels(tint_image);
+          continue;
+        }
       weight=QuantumScale*GetPixelRed(image,p)-0.5;
       pixel.red=(double) GetPixelRed(image,p)+color_vector.red*(1.0-(4.0*
         (weight*weight)));
@@ -5454,6 +5443,7 @@ MagickExport Image *TintImage(const Image *image,const char *blend,
       weight=QuantumScale*GetPixelBlack(image,p)-0.5;
       pixel.black=(double) GetPixelBlack(image,p)+color_vector.black*(1.0-(4.0*
         (weight*weight)));
+      pixel.alpha=GetPixelAlpha(image,p);
       SetPixelViaPixelInfo(tint_image,&pixel,q);
       p+=GetPixelChannels(image);
       q+=GetPixelChannels(tint_image);