title: Change image backgroud color with python
body: <p>I am trying to change the background color of an image with python and save it as a new image with that background but I can't seem to figure it out.</p>
  
  <p><a href="https://i.stack.imgur.com/S8xFd.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>This is the function i am trying to use</p>
  
  <pre><code>import cv2
  tolerancia = 10
  point = (0, 0)
  def floodFill(filename):
      cv2.imread(filename,0)
      cv2.floodFill(img, None, point, (255, 255, 0), (tolerancia,) * 3, (tolerancia,) * 3) # b g r
      cv2.imwrite('./images/fondonuevo.jpg', img)
  </code></pre>
  
  <p>Any clues on how this could work?      </p>