title: How do I read color of text from image in Python
body: <p>I am building a project that can read text from images. I also need to determine in which color this text is written. Images are computer generated and are always consist of numbers.
  I am using PyTesseract for OCR detection. Can anyone suggest to me how can I do it?</p>
  <p><a href="https://i.stack.imgur.com/AsQ2t.png" rel="nofollow noreferrer">Sample Image</a></p>
  <p>Say for example I need information in my python code like 429.05 Green</p>
  <p>My code is as bellow</p>
  <pre><code>import pytesseract
  import cv2
  
  pytesseract.pytesseract.tesseract_cmd = &quot;C:\\Program Files\\Tesseract-OCR\\tesseract.exe&quot;
  img = cv2.imread(&quot;D:\\test2.png&quot;)
  text = pytesseract.image_to_string(img)
  
  print(text)
  </code></pre>