code: def get_bits_per_pixel(data_format):
      
      if data_format in component_8bit_formats:
          return 8
      elif data_format in component_10bit_formats:
          return 10
      elif data_format in component_12bit_formats:
          return 12
      elif data_format in component_14bit_formats:
          return 14
      elif data_format in component_16bit_formats:
          return 16
      # format not known
      return None
docs: Returns the number of (used) bits per pixel.
      So without padding.
      Returns None if format is not known.