title: detect the color of text
body: <p>How to detect color from given text (image)? E.g. I've got this image</p>
  
  <p><a href="https://i.stack.imgur.com/MNhRP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MNhRP.png" alt="text image"></a></p>
  
  <p>You can clearly see the text color is black (rgb 0, 0, 0). This is how it looks when I zoom the image:
  <a href="https://i.stack.imgur.com/8wzO2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8wzO2.png" alt="zoomed text image"></a></p>
  
  <p>Now we can see there are at least 5 different colors.. <strong>How can I detect the color that human eye sees?</strong> Obviously I might take the most common color from all pixels of the image (excluding the background), but this doesn't always work (e.g. on much smaller text size where the letters are actually 1-2 pixel thick such as: </p>
  
  <p><a href="https://i.stack.imgur.com/Xinyh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Xinyh.png" alt="thin text issues"></a>.</p>