From: Cristy Date: Tue, 17 May 2016 20:50:29 +0000 (-0400) Subject: https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=29708 X-Git-Tag: 7.0.1-5~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15ea815c6ed2059efb77fda239efca10d6abfc4d;p=imagemagick https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=29708 --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 09fe914a0..e3118973b 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -1574,7 +1574,12 @@ MagickExport MagickBooleanType EqualizeImage(Image *image, { for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { - double intensity=GetPixelIntensity(image,p); + double + intensity; + + intensity=p[i]; + if ((image->channel_mask & SyncChannels) != 0) + intensity=GetPixelIntensity(image,p); histogram[GetPixelChannels(image)*ScaleQuantumToMap(intensity)+i]++; } p+=GetPixelChannels(image);