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 | |
def noisefield(): | |
im = Image.new("L", (512, 512)) | |
for x in range(512): | |
for y in range(512): | |
im.putpixel((x, y), random.choice([0,255])) | |
im.save(filepath+time.strftime('%Y%m%d%H%M%S')+".png") | |
im.show() |
im.putpixel((x, y), random.choice([0,255]))
The next step is to write modulation functions to modulate the noise field. I am working on a threshold function for when I make noise that is in grayscale. I am also trying to work out a pixelate function, which is proving more difficult than I thought.
The bit at the end with the saving of the image may look weird, but it allows me to save the image with its date and time as filename. For now, this makes it easier for me to work with my images. Here is an image made with the code above.
![]() |
Noise field generated with Python code. A.G. (c) 2017. All Rights Reserved. |
No comments:
Post a Comment