io.pil

pywi.io.pil.load_pil_image(input_file_path)[source]

Return the image array contained in the given image file.

So far, this function convert all multi-channel input images as mono-channel grayscale.

The list of supported formats is available in the following page: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html

Fits format is also supported thanks to astropy.

Parameters:input_file_path (str) – The path of the image file to load
Returns:The loaded image
Return type:ndarray
pywi.io.pil.save_pil_image(image_array, output_file_path)[source]

Save the image array image in the given file output_file_path.

The list of supported formats is available in the following page: https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html

Fits format is also supported thanks to astropy.

Parameters:
  • image (array_like) – The image to save
  • output_file_path (str) – The destination path of the image