https://irok84.itch.io/kaleidoscope-projection
Read images from files or a stream from your camera and make eye-candy Kaleidoscope effect.
- Loads still images from
./images/ - Saves snapshots to
./snapshots/(auto-created) - Great for artwork, textures, and pattern experiments
- Reads one or more RTSP camera streams
- Sources are defined in
.envas numbered keys:
RTSP_URL_1=...,RTSP_URL_2=..., etc. - Full screen mode
- Snapshot to png files
- Python 3.9+
- Common:
pygame
- RTSP version only:
opencv-python- (optional)
python-dotenv(auto-load.env; manual loader included)
Install:
pip install pygame
# for RTSP version:
pip install opencv-python python-dotenv.
├─ kaleidoscope.py # images version
├─ kaleidoscope_rtsp.py # RTSP version
├─ images/ # put source images here (png/jpg/webp/...)
├─ snapshots/ # auto-created for saved PNG snapshots
├─ .env # RTSP config (not committed)
├─ .env.dist # example to copy
└─ README.md # this fileDrop your images into ./images/.
Supported: .png .jpg .jpeg .bmp .gif .webp
Snapshots go to ./snapshots/ as snap_YYYYMMDD_HHMMSS.png.
Format of the .env file:
RTSP_URL_1=rtsp://login:password@ip_or_host.one/path
RTSP_URL_2=rtsp://login:password@ip_or_host.two/path
# RTSP_URL_3=...
# RTSP_URL_4=...If .env is missing, the app shows:
Copy .env.dist to .env and tweak RTSP_URL_1, RTSP_URL_2, ...
Sample .env.dist:
# Copy to .env and edit:
RTSP_URL_1=rtsp://user:pass@192.168.0.10:554/stream1
RTSP_URL_2=rtsp://user:pass@192.168.0.11:554/stream2# Images variant
python kaleidoscope.py
# RTSP variant
python kaleidoscope_rtsp.pyOn launch you’ll see a splash screen with controls. Press any key to start.
| Key | Action |
|---|---|
| ENTER | switch to next camera (RTSP version) |
| SPACE | next image or stream |
| A | pause, resume |
| up, down | slices |
| left, right | speed |
| F | full screen |
| P | snapshot |
| ESC, Q | quit |
Fewer SLICES ⇒ faster rendering.
RTSP: ensure FFmpeg support in OpenCV; test URLs with VLC/ffplay.
MIT
Built with Pygame and OpenCV. FFmpeg powers RTSP decoding.
Jakub Krysakowski