title: How to change white images background color to black color in one folder?
body: <p>I want to change my images background color to black color. I tried with my own codes but it did not work, moreover it remove the object. Here is my script :</p>
  
  <pre><code>image = cv2.imread("./1.jpg")
  r = 150.0 / image.shape[1]
  dim = (150, int(image.shape[0] * r))
  resized = cv2.resize(image, dim, interpolation=cv2.INTER_AREA)
  lower_white = np.array([220, 220, 220], dtype=np.uint8)
  upper_white = np.array([255, 255, 255], dtype=np.uint8)
  mask = cv2.inRange(resized, lower_white, upper_white)
  res = cv2.bitwise_not(resized, resized, mask)
  cv2.imshow('res', res)
  </code></pre>
  
  <p>I will be very appreciate if anyone could help me out.Thank you.  </p>
  
  <p><a href="https://i.stack.imgur.com/VaS38.jpg" rel="nofollow noreferrer">See the image</a></p>