Browse Source

Fix trouble with pngs

main
Maya Herrscher 2 years ago
parent
commit
470e49287c
  1. 1
      cat.py
  2. 2
      pixelflut.py

1
cat.py

@ -16,3 +16,4 @@ def cat(w, h):
if __name__ == "__main__": if __name__ == "__main__":
cat = cat(1920,1080) cat = cat(1920,1080)
cat.show() cat.show()

2
pixelflut.py

@ -57,7 +57,7 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
for w in widthlist: for w in widthlist:
if rnd: np.random.shuffle(heightlist) if rnd: np.random.shuffle(heightlist)
for h in heightlist: for h in heightlist:
color = '#%02x%02x%02x' % pixels[h-starth][w-startw] color = '#%02x%02x%02x' % pixels[h-starth][w-startw][0:3]
to_send = "px {} {} {}\n".format(w,h,color) to_send = "px {} {} {}\n".format(w,h,color)
sock.sendall(bytes(to_send, "utf-8")) sock.sendall(bytes(to_send, "utf-8"))
sock.close() sock.close()

Loading…
Cancel
Save