title: Extract most used colors in a image along with their percentage
body: <p>I am trying to create a program to extract the most used color in the image in java something similar to </p>
  
  <p><a href="http://labs.tineye.com/color/e1a28ac9e847566c18b95e7c2b26dce8dabcbbd0?ignore_background=False&amp;ignore_interior_background=False&amp;width=166&amp;height=250&amp;scroll_offset=367" rel="nofollow">http://labs.tineye.com/color/e1a28ac9e847566c18b95e7c2b26dce8dabcbbd0?ignore_background=False&amp;ignore_interior_background=False&amp;width=166&amp;height=250&amp;scroll_offset=367</a></p>
  
  <p>I followed a simple process comprising of following steps</p>
  
  <p>a) Reading all the pixels one by one.</p>
  
  <p>b) Get the RGB values from them.</p>
  
  <p>c) Store them in the map by incrementing the count in case the same pixel exists.</p>
  
  <p>d) Finally sort the list based on the maximum count. </p>
  
  <p>The problem here is that there are pixels which differ very less in appearance and is a shade of the some color.</p>
  
  <p>Hence the above algorithm output consists of pixels which are of same shade as maximum used colors along with different colors as well but my expectation is just to report different colors and not the shades of same color.</p>
  
  <p>So i want to know how to determine if a certain pixel is a different color or the shade of the color already present in the map.</p>