title: Dark borders in cv2.blur
body: <p>I have this code on python that I use as a Bloom effect on my game, but I've noticed that it has this weird black shadow around the particles</p>
  <p><a href="https://i.stack.imgur.com/AVSNo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AVSNo.png" alt="Effect in White Background" /></a>
  <a href="https://i.stack.imgur.com/4suJH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4suJH.png" alt="Effect in Grey  Background" /></a></p>
  <p>The effect looks like this ^</p>
  <p>as you can see, there is some shadows on the particles, on white background it's obvious, while in grey is subtle</p>
  <p>I would like to know if there is a way to remove/reduce this weird effect</p>
  <p>This is the code for the bloom (where the shadows are coming from):</p>
  <pre class="lang-py prettyprint-override"><code>def Bloom(canvas: pygame.Surface):
      size = canvas.get_size()
      canvas_color = pygame.surfarray.array2d(canvas)
      canvas_rgba = canvas_color.view(dtype=np.uint8).reshape((*canvas_color.shape, 4))
  
      newCanvas = pygame.Surface(size, pygame.SRCALPHA)
  
  
      cv2.blur(canvas_rgba, ksize=(9, 9), dst=canvas_rgba)
  
      
      pygame.surfarray.blit_array(newCanvas, canvas_color)
  
      return newCanvas
  
  </code></pre>
  <p>Any help would be great :3</p>
  <p>Edit: Removed the image with black background (no reason to be there)</p>