Created
July 23, 2021 03:36
-
-
Save badjano/2e0e9dae6e67c2061aeaf2c9f0cbb6ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from PIL import Image | |
arr = np.random.rand(256, 256, 4) * 255 | |
img = Image.fromarray(arr.astype('uint8'), mode="RGBA") | |
img.save("random_img.png") | |
img.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment