parameters: (
      image: Image,
      name: str,
      output_dir: Path,
      # raw_rotation: Union[None, int, list] = None,
  )
docstring: Write image to disk along with the rotations
docstring_summary: Write image to disk along with the rotations
docstring_tokens: Write image to disk along with the rotations
function: def write_image_with_rotations(
      image: Image,
      name: str,
      output_dir: Path,
      # raw_rotation: Union[None, int, list] = None,
  ) -> None:
      """
      Write image to disk along with the rotations
      """
      context_color = OVERMAP_TERRAIN_DATA.get(name)
      if context_color:
          pixels = image.load()
          height, width = image.size
          for col in range(height):
              for row in range(width):
                  if pixels[col, row] in SCHEME['replace_with_context']:
                      pixels[col, row] = context_color
  
      image.save(output_dir / f'{name}.png')
      for rotation_suffix in ROTATIONS:
          image = image.rotate(-90)
          image.save(output_dir / f'{name}{rotation_suffix}.png')
function_tokens: def write_image_with_rotations ( image : Image , name : str , output_dir : Path , # raw_rotation: Union[None, int, list] = None, ) -> None : context_color = OVERMAP_TERRAIN_DATA . get ( name ) if context_color : pixels = image . load ( ) height , width = image . size for col in range ( height ) : for row in range ( width ) : if pixels [ col , row ] in SCHEME [ 'replace_with_context' ] : pixels [ col , row ] = context_color image . save ( output_dir / f'{name}.png' ) for rotation_suffix in ROTATIONS : image = image . rotate ( - 90 ) image . save ( output_dir / f'{name}{rotation_suffix}.png' )