code: def image_data(image):
      
      # NOTE: We might want to check the actual image.mode
      #       and convert to an acceptable format.
      #       At the moment we load the data as is.
      data = image.tobytes()
      components = len(data) // (image.size[0] * image.size[1])
      return components, data
docs: Get components and bytes for an image