From: Cristy Date: Sat, 25 Aug 2018 21:10:29 +0000 (-0400) Subject: Don't composite alpha channel for -channel RGB X-Git-Tag: 7.0.8-11~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c0c6a3c748ac30045d4844e04f61097b5ae3ec8;p=imagemagick Don't composite alpha channel for -channel RGB --- diff --git a/MagickCore/composite.c b/MagickCore/composite.c index 037e40e15..4875e2455 100644 --- a/MagickCore/composite.c +++ b/MagickCore/composite.c @@ -1513,10 +1513,11 @@ MagickExport MagickBooleanType CompositeImage(Image *image, PixelChannel channel = GetPixelChannelChannel(image,i); PixelTrait traits = GetPixelChannelTraits(image,channel); - PixelTrait source_traits=GetPixelChannelTraits(source_image,channel); + PixelTrait source_traits = GetPixelChannelTraits(source_image,channel); if (traits == UndefinedPixelTrait) continue; - if (channel == AlphaPixelChannel) + if ((channel == AlphaPixelChannel) && + ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)) { /* Set alpha channel.