Article Outline
Python pil example 'white noise image'
Functions in program:
def get_white_noise_image(width, height):
python white noise image
Python pil example: white noise image
from PIL import Image
def get_white_noise_image(width, height):
pil_map = Image.new("RGBA", (width, height), 255)
random_grid = map(lambda x: (
int(random.random() * 256),
int(random.random() * 256),
int(random.random() * 256)
), [0] * width * height)
pil_map.putdata(random_grid)
return pil_map
Python links
- Learn Python: https://pythonbasics.org/
- Python Tutorial: https://pythonprogramminglanguage.com