Skip to content

Instantly share code, notes, and snippets.

@Allwin12 Allwin12/

Created May 30, 2020
What would you like to do?
import numpy as np
from PIL import Image
import random
data = np.zeros((1024, 1024, 3), dtype=np.uint8)
data[512, 512] = [254, 0, 0]
for i in range(0, 1024):
for j in range(0, 1024):
data[i, j] = [random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)]
img = Image.fromarray(data, 'RGB')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.