code: def is_overexposed(ims):
      
      if len(np.shape(ims)) == 3:
          return [is_overexposed(im) for im in ims]
  
      ims = np.array(ims, int)
      diffbincount = np.diff(np.bincount(np.ravel(ims)))
      overexposed = diffbincount[-1] > np.std(diffbincount)
      return overexposed
docs: Simple test to check if image is overexposed
  
      Parameters
      ----------
      im: 2d array integer
          the image
      Returns
      -------
      overexposed: Bool
          Is the image overexposed