Xinlong Bao包新龙

software · 2026

BeadWorks

Photograph a fuse-bead chart, detect the grid, place colours, and watch stock, used, and remaining on the LAN.

Python · FastAPI · Pillow · SQLite
Pixel heart used as a bead blueprint

Intro

A LAN app for the table next to the pegboard. Upload a pattern; the scanner estimates cell size and clusters colours in CIE Lab; the workspace highlights one colour at a time; inventory is no longer a spreadsheet.

An earlier Node sketch (FuseBeads) downsampled photos and optionally stylized them. That tree is gone. BeadWorks is the keeper: it accounts for beads you actually own.

Method

FastAPI + uvicorn, SQLite, Pillow/numpy. python run.py --port 8080 --host 0.0.0.0 prints every LAN URL. Frontend is static ES modules, no CDN. CORS is open and there is no auth — that is the LAN assumption.

Scanner: alpha under 128 is empty; 1px = 1 bead if both sides ≤ max_grid; otherwise period detection on colour-change boundaries. Cell colour is median RGB of the centre. Clusters merge under Lab distance 6; auto-map to inventory under 12. Palettes: Perler 64, Hama 50, Artkal 50. Place/unplace writes a transaction log. remaining = stock − used, and the UI warns instead of blocking when you go negative.

Demo

Install requirements, run run.py, open the printed URL on a phone. Upload a pixel PNG, tap a legend colour, paint, watch remaining drop. Inventory can import a palette. Stats lists the last hundred transactions. tests/make_samples.py builds the 11×10 heart used here.

Conclusion

A finished hobby tool: scanner, accounting rules, tests, a phone-sized workspace. Not a cloud product. Not the old Node stylizer.

Detected bead grid from a scanned pattern