A creative coding installation using p5.js and WebSocket. Visitors draw and color space-themed objects on their devices, then submit them to a shared projection. Drawings from multiple users (touch devices supported) are synchronized in real time and remain on the projection until the projection page is refreshed or closed.
Draw and Project
Animated Projection
Not long ago, I visited an installation by LZY Visual, an interactive media studio. Their installation allowed visitors to draw space-themed objects (using real paper and crayons), scan them, and see their drawings projected onto a wall as part of an interactive scene.
Inspired by that experience, I created a web-based version using p5.js and WebSocket, where participants can draw on their own devices and instantly send their creations to a shared projection in real time.
Challenge: It's been a long time since I make something in p5js, and this project use of a lot of p5js functions and parameters.
Solution: I had to jump into p5js reference site a lot to know how to do certain things.
Challenge: Back in the days I only make an art per an index.html, and this project need to be run on different devices (at least 1 for drawing and 1 for projection).
Solution: Watching The Coding Train's video about websocket.
Challenge: In this typical of project, I don't want to use AI generated art.
Solution: Jump into free-royalty asset sites like pixabay (for audio), vecteezy and flaticon (for drawing template). Also because the drawing templates are transparent, I had to fill the proper area of each template into white in Photopea so the default result has a baseline color.
Challenge: Usually, CDN is just enough for typical p5js projects, but this project need to be run on a server due to how Websocket works. Also, it turned out p5js is a little bit extra.
Solution: I ask LLM, they tell me to use combination of npm packages for express and socket.io, while using downloaded p5.min.js for p5js.
Challenge: It runs on my localhost, why not in the production?
Solution: Adjust PORT configuration in server.js and change io.connect() within both sketch.js (draw and projection sub-folder). Thanks to LLM.
- p5js - a friendly tool for learning to code and make art
- Node.js - a free, open-source, cross-platform JavaScript runtime environment
- Express.js - Node.js web application framework
- Socket.IO - bidirectional and low-latency communication for every platform



