Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #todo: learn how to use iterators before I blow my brains out
- from PIL import Image, ImageDraw
- import sys,random,numpy
- image_width=400
- image_height=400
- points_hor=5
- points_ver=6
- #why didnt i just use numpy's randint before? great question
- points = numpy.random.randint(256, size=(points_ver,points_hor))
- print(points)
- #deliberate misnomer for deliberate obfuscation and because its funny
- points_slopes = numpy.zeros((points_ver-1,points_hor-1))
- for y in range(0,points_ver-1):
- for x in range(0,points_hor-1):
- points_slopes[y][x] = (points[y][x+1]-points[y][x])/(image_width/points_hor)
- print(points_slopes)
- #uHHhHhHHhHHhHHH
- noise = Image.new('RGBA', [image_width, image_height], (255,255,255,200))
- draw_noise = ImageDraw.Draw(noise)
- draw_noise.rectangle([(0,0),(image_width,image_height)],fill=(10,230,230,255))
- #the process
- #for x in range(0, points_ver):
- # for y in range(0, points_hor):
- #draws ea point at location. (get ready for bilerp KRHSKJHKJEHSDKJKJHDSFKJHSD)
- # draw_noise.point([int(image_width/points_ver*x),int(image_height/points_hor*y)], (points[x][y],points[x][y],points[x][y],255))
- for x in range(0,image_width):
- for y in range(0,image_height):
- calc_color = int((x*points_slopes[int(y/(image_height/(points_ver-1)))][int(x/(image_width/(points_hor-1)))])+points[int(y/(image_height/(points_ver)))][int(x/(image_width/(points_hor)))])
- draw_noise.point([x,y],(calc_color,calc_color,calc_color,255))
- del draw_noise
- noise.save(str(points)+ "value noise",format="PNG")
- noise.show()
- #when u cant do MATh,,,,,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement