commit 94f1ab5e21844b9228848c3d915b0eff94db42b8 Author: Fisch Date: Sat Mar 31 12:10:00 2018 +0200 Initial commit diff --git a/ctdo.png b/ctdo.png new file mode 100644 index 0000000..3a98812 Binary files /dev/null and b/ctdo.png differ diff --git a/eh18-image.py b/eh18-image.py new file mode 100644 index 0000000..76e7753 --- /dev/null +++ b/eh18-image.py @@ -0,0 +1,46 @@ +import socket +import random +import time +from PIL import Image + +TCP_IP = '94.45.232.48' +TCP_PORT = 1234 +BUFFER_SIZE = 4096 + +flutwidth = 1920 +flutheight = 1080 + +width=200 +height=200 + +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +s.connect((TCP_IP, TCP_PORT)) + +c = '000000' + +im = Image.open("ctdo.png") +rgb_im = im.convert('RGB') + + +if __name__ == '__main__': + for a in range(100000): + #xv=random.randint(0,flutwidth) + #yv=random.randint(0,flutheight) + xv=flutwidth-width/2 + yv=height/2 + for i in range(width): + pixel_x=i-width/2+xv + for j in range(height): + pixel_y=j-height/2+yv + #v1=hex(random.randint(0,255))[2:] + #c=v1+v1+v1 + r, g, b = rgb_im.getpixel((i, j)) + + + #c=hex(r)+hex(g)+hex(b) + #c=hex(r) + #s.send("PX {0} {1} {2}\n".format(pixel_x, pixel_y, c)) + s.send( ('PX %d %d %02x%02x%02x\n' % (pixel_x,pixel_y,r,g,b)).encode()) + print(".") + +exit()