Skip to content

Instantly share code, notes, and snippets.

@badjano
Created July 23, 2021 03:36
Show Gist options
  • Save badjano/2e0e9dae6e67c2061aeaf2c9f0cbb6ce to your computer and use it in GitHub Desktop.
Save badjano/2e0e9dae6e67c2061aeaf2c9f0cbb6ce to your computer and use it in GitHub Desktop.
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