Skip to content

Commit 86c86d1

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick6/issues/376
1 parent 352601a commit 86c86d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

magick/statistic.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,32 +2618,32 @@ MagickExport ChannelStatistics *GetImageChannelStatistics(const Image *image,
26182618
*/
26192619
histogram[i].red*=area;
26202620
entropy=-histogram[i].red*log2(histogram[i].red)*
2621-
MagickSafeReciprocal(log10((double) number_bins.red));
2621+
MagickSafeReciprocal(log2((double) number_bins.red));
26222622
if (IsNaN(entropy) == 0)
26232623
channel_statistics[RedChannel].entropy+=entropy;
26242624
histogram[i].green*=area;
26252625
entropy=-histogram[i].green*log2(histogram[i].green)*
2626-
MagickSafeReciprocal(log10((double) number_bins.green));
2626+
MagickSafeReciprocal(log2((double) number_bins.green));
26272627
if (IsNaN(entropy) == 0)
26282628
channel_statistics[GreenChannel].entropy+=entropy;
26292629
histogram[i].blue*=area;
26302630
entropy=-histogram[i].blue*log2(histogram[i].blue)*
2631-
MagickSafeReciprocal(log10((double) number_bins.blue));
2631+
MagickSafeReciprocal(log2((double) number_bins.blue));
26322632
if (IsNaN(entropy) == 0)
26332633
channel_statistics[BlueChannel].entropy+=entropy;
26342634
if (image->matte != MagickFalse)
26352635
{
26362636
histogram[i].opacity*=area;
26372637
entropy=-histogram[i].opacity*log2(histogram[i].opacity)*
2638-
MagickSafeReciprocal(log10((double) number_bins.opacity));
2638+
MagickSafeReciprocal(log2((double) number_bins.opacity));
26392639
if (IsNaN(entropy) == 0)
26402640
channel_statistics[OpacityChannel].entropy+=entropy;
26412641
}
26422642
if (image->colorspace == CMYKColorspace)
26432643
{
26442644
histogram[i].index*=area;
26452645
entropy=-histogram[i].index*log2(histogram[i].index)*
2646-
MagickSafeReciprocal(log10((double) number_bins.index));
2646+
MagickSafeReciprocal(log2((double) number_bins.index));
26472647
if (IsNaN(entropy) == 0)
26482648
channel_statistics[IndexChannel].entropy+=entropy;
26492649
}

0 commit comments

Comments
 (0)