Skip to content

Instantly share code, notes, and snippets.

@badjano
Created Jul 23, 2021
Embed
What would you like to do?
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