parameters: (input_file, bitmap_list, channels)
docstring: Display and save a list of bitmaps.
  
    Args:
      input_file: input file name
      bitmap_list: list of numpy arrays to represent bitmap images
      channels: color channel count
docstring_summary: Display and save a list of bitmaps.
docstring_tokens: Display and save a list of bitmaps .
function: def show_and_save_bitmaps(input_file, bitmap_list, channels):
    """Display and save a list of bitmaps.
  
    Args:
      input_file: input file name
      bitmap_list: list of numpy arrays to represent bitmap images
      channels: color channel count
    """
    try:
      from PIL import Image  # pylint: disable=g-import-not-at-top
    except ImportError:
      raise NotImplementedError('Image display and save not implemented.')
  
    for idx, bitmap in enumerate(bitmap_list):
      path = os.path.dirname(os.path.abspath(input_file))
      basename = os.path.split(os.path.splitext(input_file)[0])[-1]
      outputfile = os.path.join(path, basename + '_' + str(idx) + '.bmp')
  
      if channels == 3:
        img = Image.fromarray(bitmap, 'RGB')
      else:
        img = Image.fromarray(bitmap, 'L')
  
      img.save(outputfile)
      img.show()
function_tokens: def show_and_save_bitmaps ( input_file , bitmap_list , channels ) : try : from PIL import Image # pylint: disable=g-import-not-at-top except ImportError : raise NotImplementedError ( 'Image display and save not implemented.' ) for idx , bitmap in enumerate ( bitmap_list ) : path = os . path . dirname ( os . path . abspath ( input_file ) ) basename = os . path . split ( os . path . splitext ( input_file ) [ 0 ] ) [ - 1 ] outputfile = os . path . join ( path , basename + '_' + str ( idx ) + '.bmp' ) if channels == 3 : img = Image . fromarray ( bitmap , 'RGB' ) else : img = Image . fromarray ( bitmap , 'L' ) img . save ( outputfile ) img . show ( )