Skip to content

Instantly share code, notes, and snippets.

@Dviejopomata
Created January 22, 2020 11:00
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 Dviejopomata/8becf4645d485f93f073012e069ad8e4 to your computer and use it in GitHub Desktop.
Save Dviejopomata/8becf4645d485f93f073012e069ad8e4 to your computer and use it in GitHub Desktop.
from PIL import Image
import numpy as np
width = 200
height = 200
im = Image.new('RGB', (width, height), color=(255,255,255))
tabla_pixels = im.load()
for x in range(0, width):
for y in range(0, height):
r = np.random.randint(0, 256)
g = np.random.randint(0, 256)
b = np.random.randint(0, 256)
tabla_pixels[x, y] = (r,g,b)
display(im)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment