quoting Rhetorica, Duchess of Space:
Photoshop's histogram tool. Good fucking god, never use Imagick for anything.
This this this
I ran into the imagick method while working that out and while it would work,
why would you put yourself through using that???