title: How to remove color from image
body: <p>I have an image with green background, for example:</p>
  <p><a href="https://i.stack.imgur.com/DXWdy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DXWdy.jpg" alt="enter image description here" /></a></p>
  <p>My purpose is to show everything that is not green</p>
  <p>There`s the code to highlight green</p>
  <pre class="lang-py prettyprint-override"><code>import cv2
  import numpy as np
  
  low_green = np.array([25, 52, 72])
  high_green = np.array([102, 255, 255])
  
  while True:
      img = cv2.imread('someimage.jpg')
      img = cv2.resize(img, (900, 650), interpolation=cv2.INTER_CUBIC)
  
      # convert BGR to HSV
      imgHSV = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
      # create the Mask
      mask = cv2.inRange(imgHSV, low_green, high_green)
  
      cv2.imshow(&quot;mask&quot;, mask)
      cv2.imshow(&quot;cam&quot;, img)
      cv2.waitKey(10)
  
  </code></pre>
  <p>And mask image
  <a href="https://i.stack.imgur.com/1Jdol.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Jdol.jpg" alt="enter image description here" /></a></p>
  <p>How do i show everything that is black on mask image?</p>