histogram method from imagemagick