title: python opencv detect the image is completely white
body: <p>How to detect if an image is white. It means that the image has only a white background.
  This is for black background.
  Example code:</p>
  <pre><code>image = cv2.imread(&quot;image.jpg&quot;, 0)
  if cv2.countNonZero(image) == 0:
      print &quot;Image is black&quot;
      return True
  else:
      print &quot;Colored image&quot;
      return False
  </code></pre>