/gradient.py Secret
Last active
February 15, 2021 16:58
Generates a black to white gradient, from black to white, passing through all the grey values.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import random | |
from PIL import Image | |
LINE = [] | |
for i in range(256): | |
LINE.append(i) | |
MATRIX = LINE*256 | |
nixel = iter(MATRIX) | |
def noisefield(): | |
im = Image.new("L", (256, 256)) | |
for x in range(256): | |
for y in range(256): | |
im.putpixel((x, y), next(nixel)) | |
im.save('<FILEPATH>'+time.strftime('%Y%m%d%H%M%S')+".png") | |
im.show() | |
noisefield() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment