Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Created May 30, 2020 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Allwin12/7bd1603b872386152aba7752539bef91 to your computer and use it in GitHub Desktop.
Save Allwin12/7bd1603b872386152aba7752539bef91 to your computer and use it in GitHub Desktop.
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')
img.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment