RSGISLib Test Images Tools

rsgislib.tools.testimages.create_random_int_img(output_img: str, n_bands: int, x_size: int, y_size: int, out_vals: List[int], gdalformat: str = 'KEA', datatype: int = 5, calc_stats: bool = True, tmp_path: str = None)

A function which creates an image with pixels values randomly assigned from the list in the out_vals input list.

Parameters:
  • output_img – The output image file name and path

  • n_bands – the number of bands in the output image

  • x_size – the number of pixels in the X axis

  • y_size – the number of pixels in the Y axis

  • out_vals – a list of values to be randomly populated within the output image

  • gdalformat – the output image file format (Default: KEA)

  • datatype – the output image data type (Default: rsgislib.TYPE_8UINT)

  • calc_stats – calculate image statistics and pyramids

  • tmp_path – Can optionally provide a temporary path where a reference image will be created and then removed.