How does that work?

If you have no clue about how Pixelflut works, here’s how to get started.

Connecting to the server

Your event’s server will provide information on which IP address(es) and port(s) to connect to. The most common TCP ports are 1337 (leet) and 1234. The address may even be a pixelflut.org subdomain! If you are unsure, ask your server operator.

Connecting via Wi-Fi is prohibited. Do not destroy the network for everyone else!

Statistics

Many servers provide statistics, but this very much depends on your operator. Some have a Grafana dashboard, others support the STATS Pixelflut command. Ask them if you’re unsure!

Commands

Once you are connected to the Pixelflut server via TCP (or otherwise), you can send the following commands. They always need to end with a newline. You can use netcat for manual testing.

# Set pixel at x, y position to color rrggbb (hex code)
PX <x> <y> <rrggbb>
# Some servers also support alpha
PX <x> <y> <rrggbbaa>
# Ask server for current color at x, y (server will reply with hex code)
PX <x> <y>
# Ask server for some information on supported commands and other policies
HELP
# Ask server for canvas size, response will have the format "<width> <height>"
SIZE
# Offset all future pixels from this connection
# Supported by some, but not all servers, try it out!
OFFSET <x> <y>

Example Python client

This example client connects via TCP and sends a single image to the server. You need to install the Pillow library for this to work.

#!/usr/bin/python

import sys
import socket
from PIL import Image

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((sys.argv[1], int(sys.argv[2])))

def pixel(x, y, r, g, b, a=255):
    if a == 255:
        sock.send(b'PX %d %d %02x%02x%02x\n' % (x, y, r, g, b))
    else:
        sock.send(b'PX %d %d %02x%02x%02x%02x\n' % (x, y, r, g, b, a))

im = Image.open(sys.argv[3]).convert('RGBA')
_, _, w, h = im.getbbox()
for x in range(w):
    for y in range(h):
        r, g, b, a = im.getpixel((x, y))
        pixel(x, y, r, g, b, a)

Call the script like this:

python client.py event.pixelflut.org 1234 picture.png

Getting more advanced

Once you have the basics figured out, here are some things to try:

We keep a list of Pixelflut clients here. If you are satisfied with yours, feel free to add it to the repository!