Which is not really image entropy at all, as it totally neglects spatial structure. You could sort an image and get the same entropy using the histogram approach.
Entropy usually boils down to "sum p * log(p) for all p (and possibly normalize)", assuming you have discrete probabilities p. It is not related to variance or mean.
https://github.com/reddit-archive/reddit/blob/753b17407e9a9d...
But in short, it's a histogram of the values of the pixels.