From 26a9f47a6627fafbf3a7af9341ab66cf8af7d95d Mon Sep 17 00:00:00 2001 From: Cristy Date: Sat, 3 Feb 2018 12:04:00 -0500 Subject: [PATCH] https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=33467 --- MagickCore/draw.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 8f92fbc4d..1d8bb669b 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -3485,6 +3485,11 @@ MagickExport MagickBooleanType DrawGradientImage(Image *image, offset*=PerceptibleReciprocal(length); for (x=bounding_box.x; x < (ssize_t) bounding_box.width; x++) { + if (GetPixelWriteMask(image,q) <= (QuantumRange/2)) + { + q+=GetPixelChannels(image); + continue; + } GetPixelInfoPixel(image,q,&pixel); switch (gradient->spread) { @@ -4167,6 +4172,11 @@ RestoreMSCWarning /* Fill and/or stroke. */ + if (GetPixelWriteMask(image,q) <= (QuantumRange/2)) + { + q+=GetPixelChannels(image); + continue; + } fill_alpha=GetFillAlpha(polygon_info[id],mid,fill,draw_info->fill_rule, x,y,&stroke_alpha); if (draw_info->stroke_antialias == MagickFalse) @@ -4408,6 +4418,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { + if (GetPixelWriteMask(image,q) <= (QuantumRange/2)) + { + q+=GetPixelChannels(image); + continue; + } GetPixelInfoPixel(image,q,&pixel); if (IsFuzzyEquivalencePixelInfo(&pixel,&target) == MagickFalse) { @@ -4467,6 +4482,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { + if (GetPixelWriteMask(image,q) <= (QuantumRange/2)) + { + q+=GetPixelChannels(image); + continue; + } GetFillColor(draw_info,x,y,&pixel,exception); SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q); q+=GetPixelChannels(image); @@ -4524,6 +4544,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { + if (GetPixelWriteMask(image,q) <= (QuantumRange/2)) + { + q+=GetPixelChannels(image); + continue; + } GetPixelInfoPixel(image,q,&pixel); if (IsFuzzyEquivalencePixelInfo(&pixel,&target) == MagickFalse) { @@ -4579,6 +4604,11 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, break; for (x=0; x < (ssize_t) image->columns; x++) { + if (GetPixelWriteMask(image,q) <= (QuantumRange/2)) + { + q+=GetPixelChannels(image); + continue; + } GetFillColor(draw_info,x,y,&pixel,exception); SetPixelViaPixelInfo(image,&pixel,q); q+=GetPixelChannels(image); -- 2.40.0