title: Getting TypeError when trying to read the individual values in an Image
body: <pre><code>im = ImageGrab.grab(bbox=(1367, 845, 1485,863))
  im.save(f'im_4_' + str(int(time.time())) + '.png', 'PNG')
  
  y = Image.Image.getcolors(im)
  z = len(Image.Image.getcolors(im))
  </code></pre>
  <p>Trying to use <code>len()</code> function to get my loop going.
  The code above runs some times and then other times it gives me the following error, makes no sense to this beginner.  <code>TypeError: object of type 'NoneType' has no len()</code>.</p>