title: Can I get a list of the number of different color pixels with ImageMagick?
body: <p>Let's say I have the following image:</p>
  <p><a href="https://i.stack.imgur.com/0N9iv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0N9iv.png" alt="enter image description here" /></a></p>
  <p>When I use the ImageMagick, the command <code>identify -format %k image.png</code> counts the number of different colors on this image. My output for this image is <code>1031</code>, which would mean that this image has 1031 different colors. However, visually saying I have around 5 different colors:</p>
  <pre><code>black
  white
  grey
  light green
  dark green
  </code></pre>
  <p>I'd like to find a way of getting a list of the number of major color pixels. For example, let's say that I have 1000 pixels on the last image, so I'd expect something like:</p>
  <pre><code>black:10
  white:50
  grey:200
  light green:690
  dark green:50
  </code></pre>
  <p>Is there any way to make ImageMagick display output values like the last ones? Just so I'll know the percentage of the main colors on my image?</p>