code: def get_bg_color(image, bits_per_channel=None):
  
      '''Obtains the background color from an image or array of RGB colors
  by grouping similar colors into bins and finding the most frequent
  one.
  
      '''
  
      assert image.shape[-1] == 3
  
      quantized = quantize(image, bits_per_channel).astype(int)
      packed = pack_rgb(quantized)
  
      unique, counts = np.unique(packed, return_counts=True)
  
      packed_mode = unique[counts.argmax()]
  
      return unpack_rgb(packed_modef get_bg_color(image, bits_per_channel=None):
  
      '''Obtains the background color from an image or array of RGB colors
  by grouping similar colors into bins and finding the most frequent
  one.
  
      '''
  
      assert image.shape[-1] == 3
  
      quantized = quantize(image, bits_per_channel).astype(int)
      packed = pack_rgb(quantized)
  
      unique, counts = np.unique(packed, return_counts=True)
  
      packed_mode = unique[counts.argmax()]
  
      return unpack_rgb(packed_mode)
docs: Obtains the background color from an image or array of RGB colors
  by grouping similar colors into bins and finding the most frequent
  one.