title: How to replace a part of an image with a white window?
body: <p>I am taking an RGB image as an input in Python which it obviously converts into 2D numpy array. I would like to replace only a window/part of an image by making it totally white (or replacing it with a 2D numpy array having values of only 255).</p>
  
  <p>Here's what I tried:</p>
  
  <pre><code>img[i:i+r,j:j+c] = (np.ones(shape=(r,c))) * 255
  </code></pre>
  
  <p>r,c is my window size (128*128) and my input image is of RGB channel. It throws an error:</p>
  
  <pre><code>ValueError: could not broadcast input array from shape (128,128) into shape (128,3)
  </code></pre>
  
  <p><strong>Note:</strong> I would like my final output image to be in RGB channel with specific parts replaced by white windows. I am using Python 3.5.</p>