COSIE.image_preprocessing.save_jpg

save_jpg(img_array, file_name)[source]

Convert a NumPy array into a JPEG image and save it to disk.

Parameters

img_arraynp.ndarray

Input image as a NumPy array. The array should represent a grayscale or RGB image, and will be cast to uint8 before saving.

file_namestr

The name to save the image as. The .jpg extension will be automatically appended.

Returns

None

The image is saved as a JPEG file at the specified location.