Pixelframe is a rewrite of the Pixelflut Project, compatible with Python 3.
I wanted to use the Pixelflut project for a university project, but I found out that it was written in Python 2, which is heavily outdated, so I created this.
Since this is a rewrite of the entire original project, I also added some features the old one has not.
Based on numpy, the new heart of the canvas is almost 6x faster* than the old version. It is also very efficient in performing actions on large data like a picture with metadata for every pixel.
*Based on calculations
Shows the canvas in a browser Can display the current canvas, also featuring the integrated Documentation on /docs and /redoc
Displays the canvas on a local display connected to the host.
PyGame isn't exactly a new feature, but its optional now. Also, you can display a stats bar for connection details and basic stats of the canvas when using in public.
Note: this feature requires a host with graphic drivers, e.g. Docker containers won't work!
Based on FastAPI, can update pixels and also hosting the Webinterface
Usage [Coming Soon]
Like the old version, this project uses sockets to communicate with the players. You can set pixels, get pixel colors and even view stats for the whole canvas. New features are a timeout for the connection and a cooldown for spam protection.
A config for creating templates and sharing them, made easy.
Options
- Name
- Game Rules
- Frontends Settings
- Connection Infos
- Canvas Settings
cd pixelframe
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
Server
Take a look at the [config file]()Certificates (HTTPS)
This requires NGINX or equal! PixelFrame doesn't support Certificates natively.
If you want to install PixelFrame on a server with Certificates to enable encryption for the API with HTTPS you have to make sure you don't overlap any ports.
Use port 8443
(or any port with X443) for the API since other ports won't accept encryption. But I recommend to use port 8000
for the base of the API and then map 8080
(HTTP) and/or 8443
(HTTPS) to the base.
python3 [-c configfile] pixelframe.py
If you want to improve this repository, feel free to contribute.
Please install dev-requirement.txt
, comment your changes properly and run the following script before committing:
python3 -m black .
python3 -m isort .
- Pixelflut - A lot of inspiration and code snippets
- Leon - The
STATS
command - LyonsType - The font
LT Superior Mono
Most of the HTML and JS code if very sketchy and copied together from diverse websites, so there might be some bugs here and there. Contribute if you want to improve it, I'd appreciate it very much!