Fix trouble with pngs

This commit is contained in:
Maya Herrscher committed 2023-10-10 15:13:54 +02:00
1 parent de6736144b
commit 470e49287c
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -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()
+1 -1
View File
@@ -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()