from PIL import Image im = Image.fromarray(A) im.save("your_file.jpeg")
Here is what the above code is Doing:
1. We import the Image module from the PIL library.
2. We create an Image object and pass the image data (e.g. the pixel values of the image) to this object.
3. We call the save() function on the image object to save the image to a file.