title: How to count bright pixels in an image?
body: <p>How do I make this code print the total number of bright pixels that are over 200:</p>
  
  <pre><code>from PIL import Image
  img = input("File name: ")
  img = Image.open(img);
  for y in range(img.height):
    for x in range(img.width):
      pixel = img.getpixel((x, y))
      if pixel &gt;= 200:
        print(pixel,"pixels are bright.")
  </code></pre>
  
  <p>Right now it's printing <strong>every</strong> single pixel that is over 200 on new lines, but I just want one line that prints the total like this: </p>
  
  <pre class="lang-none prettyprint-override"><code>File name: slippers.png
  121081 pixels are bright.      
  </code></pre>