title: Use numpy to make mask array for pixels of certain value
body: <p>In processing an image, I would like to ignore all white pixels. I figure the best way to do this is to set the mask array to change the mask array where there are white pixels as soon as I initialize it. To do this I use the method described on the last line of the following code.</p>
  
  <pre><code>with PIL.Image.open(picture) as im:
      pix = numpy.array(im, dtype=numpy.float)
  [height, width, _] = pix.shape
  mask = numpy.zeros((height,width))
  mask[numpy.argwhere(pix == [255,255,255])] = 1
  </code></pre>
  
  <p>However, this line generates the following error:</p>
  
  <pre><code>  File "C:\Users\Alec\zone_map.py", line 19, in zone_map
      mask[numpy.argwhere(pix == [255,255,255])] = 1
  
  IndexError: index 5376 is out of bounds for axis 0 with size 4000
  </code></pre>
  
  <p>How can I change this to accomplish the desired result?</p>