Histogram for images

It would be really great if the picture viewer could show the histogram for any displayed image.

For a regular function in Opus it sounds rather non-trivial to me, given that some users also may want separate RGB channels and luminosity as well. But there are some histogram generator tools out in the web. Maybe there is a way to get them to work with Opus?