xlu
3/9/2018 - 7:36 PM

where to find GetImageChannelEntropy

where to find GetImageChannelEntropy

except I don't see a `GetImageChannelEntropy` on the C side... there's a `GetImageEntropy` but I don't see a channel one
...

GetImageChannelMean doesn't actually seem to exist in the ImageMagick library -- I have no idea where rmagick is pulling that from... maybe some old version of ImageMagick?
https://github.com/rmagick/rmagick/blob/develop/ext/RMagick/rmimage.c#L2317
GitHub
rmagick/rmagick
rmagick - Ruby bindings for ImageMagick
is calling GetImageChannelMean, but that function does not seem to exist, anywhere, that I can find
It's not anywhere in the ImageMagick headers
the `identify` command line tool uses the function `GetImageStatistics` which calculates the statistics for all the channels, including entropy for each channel
But it's not clear to me what rmagick is doing, since it seems to be calling C functions that do not exist in the current ImageMagick library...
Ah, yup... when I checkout 6.9.4 in the ImageMagick repo, then indeed GetImageChannelMean is there...  but it's not in 7.0 any more
and they seem to have moved to GetImageStatistics...
So I guess rmagick is using 6.x not 7.x
so we need to look in 6.x for how to get channel entropy there...
...and yes, there is indeed this function there: `  GetImageChannelEntropy(const Image *,const ChannelType,double *,    ExceptionInfo *),`
which exactly mirrors the `GetImageChannelMean`